proteus  1.7.4
C/C++/Fortran libraries
csmoothers.c
Go to the documentation of this file.
1 /* Generated by Cython 0.29.16 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6  #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8  #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_16"
11 #define CYTHON_HEX_VERSION 0x001D10F0
12 #define CYTHON_FUTURE_DIVISION 0
13 #include <stddef.h>
14 #ifndef offsetof
15  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18  #ifndef __stdcall
19  #define __stdcall
20  #endif
21  #ifndef __cdecl
22  #define __cdecl
23  #endif
24  #ifndef __fastcall
25  #define __fastcall
26  #endif
27 #endif
28 #ifndef DL_IMPORT
29  #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32  #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36  #if PY_VERSION_HEX >= 0x02070000
37  #define HAVE_LONG_LONG
38  #endif
39 #endif
40 #ifndef PY_LONG_LONG
41  #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44  #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47  #define CYTHON_COMPILING_IN_PYPY 1
48  #define CYTHON_COMPILING_IN_PYSTON 0
49  #define CYTHON_COMPILING_IN_CPYTHON 0
50  #undef CYTHON_USE_TYPE_SLOTS
51  #define CYTHON_USE_TYPE_SLOTS 0
52  #undef CYTHON_USE_PYTYPE_LOOKUP
53  #define CYTHON_USE_PYTYPE_LOOKUP 0
54  #if PY_VERSION_HEX < 0x03050000
55  #undef CYTHON_USE_ASYNC_SLOTS
56  #define CYTHON_USE_ASYNC_SLOTS 0
57  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58  #define CYTHON_USE_ASYNC_SLOTS 1
59  #endif
60  #undef CYTHON_USE_PYLIST_INTERNALS
61  #define CYTHON_USE_PYLIST_INTERNALS 0
62  #undef CYTHON_USE_UNICODE_INTERNALS
63  #define CYTHON_USE_UNICODE_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_WRITER
65  #define CYTHON_USE_UNICODE_WRITER 0
66  #undef CYTHON_USE_PYLONG_INTERNALS
67  #define CYTHON_USE_PYLONG_INTERNALS 0
68  #undef CYTHON_AVOID_BORROWED_REFS
69  #define CYTHON_AVOID_BORROWED_REFS 1
70  #undef CYTHON_ASSUME_SAFE_MACROS
71  #define CYTHON_ASSUME_SAFE_MACROS 0
72  #undef CYTHON_UNPACK_METHODS
73  #define CYTHON_UNPACK_METHODS 0
74  #undef CYTHON_FAST_THREAD_STATE
75  #define CYTHON_FAST_THREAD_STATE 0
76  #undef CYTHON_FAST_PYCALL
77  #define CYTHON_FAST_PYCALL 0
78  #undef CYTHON_PEP489_MULTI_PHASE_INIT
79  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80  #undef CYTHON_USE_TP_FINALIZE
81  #define CYTHON_USE_TP_FINALIZE 0
82  #undef CYTHON_USE_DICT_VERSIONS
83  #define CYTHON_USE_DICT_VERSIONS 0
84  #undef CYTHON_USE_EXC_INFO_STACK
85  #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87  #define CYTHON_COMPILING_IN_PYPY 0
88  #define CYTHON_COMPILING_IN_PYSTON 1
89  #define CYTHON_COMPILING_IN_CPYTHON 0
90  #ifndef CYTHON_USE_TYPE_SLOTS
91  #define CYTHON_USE_TYPE_SLOTS 1
92  #endif
93  #undef CYTHON_USE_PYTYPE_LOOKUP
94  #define CYTHON_USE_PYTYPE_LOOKUP 0
95  #undef CYTHON_USE_ASYNC_SLOTS
96  #define CYTHON_USE_ASYNC_SLOTS 0
97  #undef CYTHON_USE_PYLIST_INTERNALS
98  #define CYTHON_USE_PYLIST_INTERNALS 0
99  #ifndef CYTHON_USE_UNICODE_INTERNALS
100  #define CYTHON_USE_UNICODE_INTERNALS 1
101  #endif
102  #undef CYTHON_USE_UNICODE_WRITER
103  #define CYTHON_USE_UNICODE_WRITER 0
104  #undef CYTHON_USE_PYLONG_INTERNALS
105  #define CYTHON_USE_PYLONG_INTERNALS 0
106  #ifndef CYTHON_AVOID_BORROWED_REFS
107  #define CYTHON_AVOID_BORROWED_REFS 0
108  #endif
109  #ifndef CYTHON_ASSUME_SAFE_MACROS
110  #define CYTHON_ASSUME_SAFE_MACROS 1
111  #endif
112  #ifndef CYTHON_UNPACK_METHODS
113  #define CYTHON_UNPACK_METHODS 1
114  #endif
115  #undef CYTHON_FAST_THREAD_STATE
116  #define CYTHON_FAST_THREAD_STATE 0
117  #undef CYTHON_FAST_PYCALL
118  #define CYTHON_FAST_PYCALL 0
119  #undef CYTHON_PEP489_MULTI_PHASE_INIT
120  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121  #undef CYTHON_USE_TP_FINALIZE
122  #define CYTHON_USE_TP_FINALIZE 0
123  #undef CYTHON_USE_DICT_VERSIONS
124  #define CYTHON_USE_DICT_VERSIONS 0
125  #undef CYTHON_USE_EXC_INFO_STACK
126  #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128  #define CYTHON_COMPILING_IN_PYPY 0
129  #define CYTHON_COMPILING_IN_PYSTON 0
130  #define CYTHON_COMPILING_IN_CPYTHON 1
131  #ifndef CYTHON_USE_TYPE_SLOTS
132  #define CYTHON_USE_TYPE_SLOTS 1
133  #endif
134  #if PY_VERSION_HEX < 0x02070000
135  #undef CYTHON_USE_PYTYPE_LOOKUP
136  #define CYTHON_USE_PYTYPE_LOOKUP 0
137  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138  #define CYTHON_USE_PYTYPE_LOOKUP 1
139  #endif
140  #if PY_MAJOR_VERSION < 3
141  #undef CYTHON_USE_ASYNC_SLOTS
142  #define CYTHON_USE_ASYNC_SLOTS 0
143  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144  #define CYTHON_USE_ASYNC_SLOTS 1
145  #endif
146  #if PY_VERSION_HEX < 0x02070000
147  #undef CYTHON_USE_PYLONG_INTERNALS
148  #define CYTHON_USE_PYLONG_INTERNALS 0
149  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150  #define CYTHON_USE_PYLONG_INTERNALS 1
151  #endif
152  #ifndef CYTHON_USE_PYLIST_INTERNALS
153  #define CYTHON_USE_PYLIST_INTERNALS 1
154  #endif
155  #ifndef CYTHON_USE_UNICODE_INTERNALS
156  #define CYTHON_USE_UNICODE_INTERNALS 1
157  #endif
158  #if PY_VERSION_HEX < 0x030300F0
159  #undef CYTHON_USE_UNICODE_WRITER
160  #define CYTHON_USE_UNICODE_WRITER 0
161  #elif !defined(CYTHON_USE_UNICODE_WRITER)
162  #define CYTHON_USE_UNICODE_WRITER 1
163  #endif
164  #ifndef CYTHON_AVOID_BORROWED_REFS
165  #define CYTHON_AVOID_BORROWED_REFS 0
166  #endif
167  #ifndef CYTHON_ASSUME_SAFE_MACROS
168  #define CYTHON_ASSUME_SAFE_MACROS 1
169  #endif
170  #ifndef CYTHON_UNPACK_METHODS
171  #define CYTHON_UNPACK_METHODS 1
172  #endif
173  #ifndef CYTHON_FAST_THREAD_STATE
174  #define CYTHON_FAST_THREAD_STATE 1
175  #endif
176  #ifndef CYTHON_FAST_PYCALL
177  #define CYTHON_FAST_PYCALL 1
178  #endif
179  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181  #endif
182  #ifndef CYTHON_USE_TP_FINALIZE
183  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184  #endif
185  #ifndef CYTHON_USE_DICT_VERSIONS
186  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187  #endif
188  #ifndef CYTHON_USE_EXC_INFO_STACK
189  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190  #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196  #include "longintrepr.h"
197  #undef SHIFT
198  #undef BASE
199  #undef MASK
200  #ifdef SIZEOF_VOID_P
201  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202  #endif
203 #endif
204 #ifndef __has_attribute
205  #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208  #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211  #if defined(__GNUC__)
212  #define CYTHON_RESTRICT __restrict__
213  #elif defined(_MSC_VER) && _MSC_VER >= 1400
214  #define CYTHON_RESTRICT __restrict
215  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216  #define CYTHON_RESTRICT restrict
217  #else
218  #define CYTHON_RESTRICT
219  #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
225 # else
226 # define CYTHON_UNUSED
227 # endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 # define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
236  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 # else
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 # endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
244 # else
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250  #ifndef _MSC_STDINT_H_
251  #if _MSC_VER < 1300
252  typedef unsigned char uint8_t;
253  typedef unsigned int uint32_t;
254  #else
255  typedef unsigned __int8 uint8_t;
256  typedef unsigned __int32 uint32_t;
257  #endif
258  #endif
259 #else
260  #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263  #if defined(__cplusplus) && __cplusplus >= 201103L
264  #if __has_cpp_attribute(fallthrough)
265  #define CYTHON_FALLTHROUGH [[fallthrough]]
266  #elif __has_cpp_attribute(clang::fallthrough)
267  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268  #elif __has_cpp_attribute(gnu::fallthrough)
269  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270  #endif
271  #endif
272  #ifndef CYTHON_FALLTHROUGH
273  #if __has_attribute(fallthrough)
274  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275  #else
276  #define CYTHON_FALLTHROUGH
277  #endif
278  #endif
279  #if defined(__clang__ ) && defined(__apple_build_version__)
280  #if __apple_build_version__ < 7000000
281  #undef CYTHON_FALLTHROUGH
282  #define CYTHON_FALLTHROUGH
283  #endif
284  #endif
285 #endif
286 
287 #ifndef CYTHON_INLINE
288  #if defined(__clang__)
289  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
290  #elif defined(__GNUC__)
291  #define CYTHON_INLINE __inline__
292  #elif defined(_MSC_VER)
293  #define CYTHON_INLINE __inline
294  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
295  #define CYTHON_INLINE inline
296  #else
297  #define CYTHON_INLINE
298  #endif
299 #endif
300 
301 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
302  #define Py_OptimizeFlag 0
303 #endif
304 #define __PYX_BUILD_PY_SSIZE_T "n"
305 #define CYTHON_FORMAT_SSIZE_T "z"
306 #if PY_MAJOR_VERSION < 3
307  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
308  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
309  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
310  #define __Pyx_DefaultClassType PyClass_Type
311 #else
312  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
313 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
314  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
315  PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
316 #else
317  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
318  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
319 #endif
320  #define __Pyx_DefaultClassType PyType_Type
321 #endif
322 #ifndef Py_TPFLAGS_CHECKTYPES
323  #define Py_TPFLAGS_CHECKTYPES 0
324 #endif
325 #ifndef Py_TPFLAGS_HAVE_INDEX
326  #define Py_TPFLAGS_HAVE_INDEX 0
327 #endif
328 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
329  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
330 #endif
331 #ifndef Py_TPFLAGS_HAVE_FINALIZE
332  #define Py_TPFLAGS_HAVE_FINALIZE 0
333 #endif
334 #ifndef METH_STACKLESS
335  #define METH_STACKLESS 0
336 #endif
337 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
338  #ifndef METH_FASTCALL
339  #define METH_FASTCALL 0x80
340  #endif
341  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
342  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
343  Py_ssize_t nargs, PyObject *kwnames);
344 #else
345  #define __Pyx_PyCFunctionFast _PyCFunctionFast
346  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
347 #endif
348 #if CYTHON_FAST_PYCCALL
349 #define __Pyx_PyFastCFunction_Check(func)\
350  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
351 #else
352 #define __Pyx_PyFastCFunction_Check(func) 0
353 #endif
354 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
355  #define PyObject_Malloc(s) PyMem_Malloc(s)
356  #define PyObject_Free(p) PyMem_Free(p)
357  #define PyObject_Realloc(p) PyMem_Realloc(p)
358 #endif
359 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
360  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
361  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
362  #define PyMem_RawFree(p) PyMem_Free(p)
363 #endif
364 #if CYTHON_COMPILING_IN_PYSTON
365  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
366  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
367 #else
368  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
369  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
370 #endif
371 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
372  #define __Pyx_PyThreadState_Current PyThreadState_GET()
373 #elif PY_VERSION_HEX >= 0x03060000
374  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
375 #elif PY_VERSION_HEX >= 0x03000000
376  #define __Pyx_PyThreadState_Current PyThreadState_GET()
377 #else
378  #define __Pyx_PyThreadState_Current _PyThreadState_Current
379 #endif
380 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
381 #include "pythread.h"
382 #define Py_tss_NEEDS_INIT 0
383 typedef int Py_tss_t;
384 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
385  *key = PyThread_create_key();
386  return 0;
387 }
388 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
389  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
390  *key = Py_tss_NEEDS_INIT;
391  return key;
392 }
393 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
394  PyObject_Free(key);
395 }
396 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
397  return *key != Py_tss_NEEDS_INIT;
398 }
399 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
400  PyThread_delete_key(*key);
401  *key = Py_tss_NEEDS_INIT;
402 }
403 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
404  return PyThread_set_key_value(*key, value);
405 }
406 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
407  return PyThread_get_key_value(*key);
408 }
409 #endif
410 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
411 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
412 #else
413 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
414 #endif
415 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
416  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
417  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
418 #else
419  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
420  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
421 #endif
422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
423 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
424 #else
425 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
426 #endif
427 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
428  #define CYTHON_PEP393_ENABLED 1
429  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
430  0 : _PyUnicode_Ready((PyObject *)(op)))
431  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
432  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
433  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
434  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
435  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
436  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
437  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
438  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
439 #else
440  #define CYTHON_PEP393_ENABLED 0
441  #define PyUnicode_1BYTE_KIND 1
442  #define PyUnicode_2BYTE_KIND 2
443  #define PyUnicode_4BYTE_KIND 4
444  #define __Pyx_PyUnicode_READY(op) (0)
445  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
446  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
447  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
448  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
449  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
450  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
451  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
452  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
453 #endif
454 #if CYTHON_COMPILING_IN_PYPY
455  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
456  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
457 #else
458  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
459  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
460  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
461 #endif
462 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
463  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
464 #endif
465 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
466  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
467 #endif
468 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
469  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
470 #endif
471 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
472 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
473 #if PY_MAJOR_VERSION >= 3
474  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
475 #else
476  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
477 #endif
478 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
479  #define PyObject_ASCII(o) PyObject_Repr(o)
480 #endif
481 #if PY_MAJOR_VERSION >= 3
482  #define PyBaseString_Type PyUnicode_Type
483  #define PyStringObject PyUnicodeObject
484  #define PyString_Type PyUnicode_Type
485  #define PyString_Check PyUnicode_Check
486  #define PyString_CheckExact PyUnicode_CheckExact
487 #ifndef PyObject_Unicode
488  #define PyObject_Unicode PyObject_Str
489 #endif
490 #endif
491 #if PY_MAJOR_VERSION >= 3
492  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
493  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
494 #else
495  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
496  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
497 #endif
498 #ifndef PySet_CheckExact
499  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
500 #endif
501 #if CYTHON_ASSUME_SAFE_MACROS
502  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
503 #else
504  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
505 #endif
506 #if PY_MAJOR_VERSION >= 3
507  #define PyIntObject PyLongObject
508  #define PyInt_Type PyLong_Type
509  #define PyInt_Check(op) PyLong_Check(op)
510  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
511  #define PyInt_FromString PyLong_FromString
512  #define PyInt_FromUnicode PyLong_FromUnicode
513  #define PyInt_FromLong PyLong_FromLong
514  #define PyInt_FromSize_t PyLong_FromSize_t
515  #define PyInt_FromSsize_t PyLong_FromSsize_t
516  #define PyInt_AsLong PyLong_AsLong
517  #define PyInt_AS_LONG PyLong_AS_LONG
518  #define PyInt_AsSsize_t PyLong_AsSsize_t
519  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
520  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
521  #define PyNumber_Int PyNumber_Long
522 #endif
523 #if PY_MAJOR_VERSION >= 3
524  #define PyBoolObject PyLongObject
525 #endif
526 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
527  #ifndef PyUnicode_InternFromString
528  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
529  #endif
530 #endif
531 #if PY_VERSION_HEX < 0x030200A4
532  typedef long Py_hash_t;
533  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
534  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
535 #else
536  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
537  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
538 #endif
539 #if PY_MAJOR_VERSION >= 3
540  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
541 #else
542  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
543 #endif
544 #if CYTHON_USE_ASYNC_SLOTS
545  #if PY_VERSION_HEX >= 0x030500B1
546  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
547  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
548  #else
549  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
550  #endif
551 #else
552  #define __Pyx_PyType_AsAsync(obj) NULL
553 #endif
554 #ifndef __Pyx_PyAsyncMethodsStruct
555  typedef struct {
556  unaryfunc am_await;
557  unaryfunc am_aiter;
558  unaryfunc am_anext;
559  } __Pyx_PyAsyncMethodsStruct;
560 #endif
561 
562 #if defined(WIN32) || defined(MS_WINDOWS)
563  #define _USE_MATH_DEFINES
564 #endif
565 #include <math.h>
566 #ifdef NAN
567 #define __PYX_NAN() ((float) NAN)
568 #else
569 static CYTHON_INLINE float __PYX_NAN() {
570  float value;
571  memset(&value, 0xFF, sizeof(value));
572  return value;
573 }
574 #endif
575 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
576 #define __Pyx_truncl trunc
577 #else
578 #define __Pyx_truncl truncl
579 #endif
580 
581 
582 #define __PYX_ERR(f_index, lineno, Ln_error) \
583 { \
584  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
585 }
586 
587 #ifndef __PYX_EXTERN_C
588  #ifdef __cplusplus
589  #define __PYX_EXTERN_C extern "C"
590  #else
591  #define __PYX_EXTERN_C extern
592  #endif
593 #endif
594 
595 #define __PYX_HAVE__csmoothers
596 #define __PYX_HAVE_API__csmoothers
597 /* Early includes */
598 #include <string.h>
599 #include <stdio.h>
600 #include "numpy/arrayobject.h"
601 #include "numpy/ufuncobject.h"
602 #include "proteus_superlu.h"
603 #include "smoothers.h"
604 #include "pythread.h"
605 #include <stdlib.h>
606 #include "pystate.h"
607 #ifdef _OPENMP
608 #include <omp.h>
609 #endif /* _OPENMP */
610 
611 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
612 #define CYTHON_WITHOUT_ASSERTIONS
613 #endif
614 
615 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
616  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
617 
618 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
619 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
620 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
621 #define __PYX_DEFAULT_STRING_ENCODING ""
622 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
623 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
624 #define __Pyx_uchar_cast(c) ((unsigned char)c)
625 #define __Pyx_long_cast(x) ((long)x)
626 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
627  (sizeof(type) < sizeof(Py_ssize_t)) ||\
628  (sizeof(type) > sizeof(Py_ssize_t) &&\
629  likely(v < (type)PY_SSIZE_T_MAX ||\
630  v == (type)PY_SSIZE_T_MAX) &&\
631  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
632  v == (type)PY_SSIZE_T_MIN))) ||\
633  (sizeof(type) == sizeof(Py_ssize_t) &&\
634  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
635  v == (type)PY_SSIZE_T_MAX))) )
636 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
637  return (size_t) i < (size_t) limit;
638 }
639 #if defined (__cplusplus) && __cplusplus >= 201103L
640  #include <cstdlib>
641  #define __Pyx_sst_abs(value) std::abs(value)
642 #elif SIZEOF_INT >= SIZEOF_SIZE_T
643  #define __Pyx_sst_abs(value) abs(value)
644 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
645  #define __Pyx_sst_abs(value) labs(value)
646 #elif defined (_MSC_VER)
647  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
648 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
649  #define __Pyx_sst_abs(value) llabs(value)
650 #elif defined (__GNUC__)
651  #define __Pyx_sst_abs(value) __builtin_llabs(value)
652 #else
653  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
654 #endif
655 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
656 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
657 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
658 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
659 #define __Pyx_PyBytes_FromString PyBytes_FromString
660 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
661 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
662 #if PY_MAJOR_VERSION < 3
663  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
664  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
665 #else
666  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
667  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
668 #endif
669 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
670 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
671 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
672 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
673 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
674 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
675 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
676 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
677 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
678 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
679 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
680 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
681 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
682 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
683 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
684 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
685 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
686  const Py_UNICODE *u_end = u;
687  while (*u_end++) ;
688  return (size_t)(u_end - u - 1);
689 }
690 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
691 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
692 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
693 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
694 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
695 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
696 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
697 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
698 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
699 #define __Pyx_PySequence_Tuple(obj)\
700  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
701 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
702 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
703 #if CYTHON_ASSUME_SAFE_MACROS
704 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
705 #else
706 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
707 #endif
708 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
709 #if PY_MAJOR_VERSION >= 3
710 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
711 #else
712 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
713 #endif
714 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
715 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
716 static int __Pyx_sys_getdefaultencoding_not_ascii;
717 static int __Pyx_init_sys_getdefaultencoding_params(void) {
718  PyObject* sys;
719  PyObject* default_encoding = NULL;
720  PyObject* ascii_chars_u = NULL;
721  PyObject* ascii_chars_b = NULL;
722  const char* default_encoding_c;
723  sys = PyImport_ImportModule("sys");
724  if (!sys) goto bad;
725  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
726  Py_DECREF(sys);
727  if (!default_encoding) goto bad;
728  default_encoding_c = PyBytes_AsString(default_encoding);
729  if (!default_encoding_c) goto bad;
730  if (strcmp(default_encoding_c, "ascii") == 0) {
731  __Pyx_sys_getdefaultencoding_not_ascii = 0;
732  } else {
733  char ascii_chars[128];
734  int c;
735  for (c = 0; c < 128; c++) {
736  ascii_chars[c] = c;
737  }
738  __Pyx_sys_getdefaultencoding_not_ascii = 1;
739  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
740  if (!ascii_chars_u) goto bad;
741  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
742  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
743  PyErr_Format(
744  PyExc_ValueError,
745  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
746  default_encoding_c);
747  goto bad;
748  }
749  Py_DECREF(ascii_chars_u);
750  Py_DECREF(ascii_chars_b);
751  }
752  Py_DECREF(default_encoding);
753  return 0;
754 bad:
755  Py_XDECREF(default_encoding);
756  Py_XDECREF(ascii_chars_u);
757  Py_XDECREF(ascii_chars_b);
758  return -1;
759 }
760 #endif
761 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
762 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
763 #else
764 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
765 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
766 static char* __PYX_DEFAULT_STRING_ENCODING;
767 static int __Pyx_init_sys_getdefaultencoding_params(void) {
768  PyObject* sys;
769  PyObject* default_encoding = NULL;
770  char* default_encoding_c;
771  sys = PyImport_ImportModule("sys");
772  if (!sys) goto bad;
773  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
774  Py_DECREF(sys);
775  if (!default_encoding) goto bad;
776  default_encoding_c = PyBytes_AsString(default_encoding);
777  if (!default_encoding_c) goto bad;
778  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
779  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
780  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
781  Py_DECREF(default_encoding);
782  return 0;
783 bad:
784  Py_XDECREF(default_encoding);
785  return -1;
786 }
787 #endif
788 #endif
789 
790 
791 /* Test for GCC > 2.95 */
792 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
793  #define likely(x) __builtin_expect(!!(x), 1)
794  #define unlikely(x) __builtin_expect(!!(x), 0)
795 #else /* !__GNUC__ or GCC < 2.95 */
796  #define likely(x) (x)
797  #define unlikely(x) (x)
798 #endif /* __GNUC__ */
799 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
800 
801 static PyObject *__pyx_m = NULL;
802 static PyObject *__pyx_d;
803 static PyObject *__pyx_b;
804 static PyObject *__pyx_cython_runtime = NULL;
805 static PyObject *__pyx_empty_tuple;
806 static PyObject *__pyx_empty_bytes;
807 static PyObject *__pyx_empty_unicode;
808 static int __pyx_lineno;
809 static int __pyx_clineno = 0;
810 static const char * __pyx_cfilenm= __FILE__;
811 static const char *__pyx_filename;
812 
813 /* Header.proto */
814 #if !defined(CYTHON_CCOMPLEX)
815  #if defined(__cplusplus)
816  #define CYTHON_CCOMPLEX 1
817  #elif defined(_Complex_I)
818  #define CYTHON_CCOMPLEX 1
819  #else
820  #define CYTHON_CCOMPLEX 0
821  #endif
822 #endif
823 #if CYTHON_CCOMPLEX
824  #ifdef __cplusplus
825  #include <complex>
826  #else
827  #include <complex.h>
828  #endif
829 #endif
830 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
831  #undef _Complex_I
832  #define _Complex_I 1.0fj
833 #endif
834 
835 
836 static const char *__pyx_f[] = {
837  "proteus/csmoothers.pyx",
838  "stringsource",
839  "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd",
840  "linux/lib/python3.7/site-packages/Cython/Includes/cpython/type.pxd",
841  "proteus/superluWrappers.pxd",
842 };
843 /* MemviewSliceStruct.proto */
844 struct __pyx_memoryview_obj;
845 typedef struct {
846  struct __pyx_memoryview_obj *memview;
847  char *data;
848  Py_ssize_t shape[8];
849  Py_ssize_t strides[8];
850  Py_ssize_t suboffsets[8];
851 } __Pyx_memviewslice;
852 #define __Pyx_MemoryView_Len(m) (m.shape[0])
853 
854 /* Atomics.proto */
855 #include <pythread.h>
856 #ifndef CYTHON_ATOMICS
857  #define CYTHON_ATOMICS 1
858 #endif
859 #define __pyx_atomic_int_type int
860 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
861  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
862  !defined(__i386__)
863  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
864  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
865  #ifdef __PYX_DEBUG_ATOMICS
866  #warning "Using GNU atomics"
867  #endif
868 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
869  #include <Windows.h>
870  #undef __pyx_atomic_int_type
871  #define __pyx_atomic_int_type LONG
872  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
873  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
874  #ifdef __PYX_DEBUG_ATOMICS
875  #pragma message ("Using MSVC atomics")
876  #endif
877 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
878  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
879  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
880  #ifdef __PYX_DEBUG_ATOMICS
881  #warning "Using Intel atomics"
882  #endif
883 #else
884  #undef CYTHON_ATOMICS
885  #define CYTHON_ATOMICS 0
886  #ifdef __PYX_DEBUG_ATOMICS
887  #warning "Not using atomics"
888  #endif
889 #endif
890 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
891 #if CYTHON_ATOMICS
892  #define __pyx_add_acquisition_count(memview)\
893  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
894  #define __pyx_sub_acquisition_count(memview)\
895  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
896 #else
897  #define __pyx_add_acquisition_count(memview)\
898  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
899  #define __pyx_sub_acquisition_count(memview)\
900  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
901 #endif
902 
903 /* ForceInitThreads.proto */
904 #ifndef __PYX_FORCE_INIT_THREADS
905  #define __PYX_FORCE_INIT_THREADS 0
906 #endif
907 
908 /* NoFastGil.proto */
909 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
910 #define __Pyx_PyGILState_Release PyGILState_Release
911 #define __Pyx_FastGIL_Remember()
912 #define __Pyx_FastGIL_Forget()
913 #define __Pyx_FastGilFuncInit()
914 
915 /* BufferFormatStructs.proto */
916 #define IS_UNSIGNED(type) (((type) -1) > 0)
917 struct __Pyx_StructField_;
918 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
919 typedef struct {
920  const char* name;
921  struct __Pyx_StructField_* fields;
922  size_t size;
923  size_t arraysize[8];
924  int ndim;
925  char typegroup;
926  char is_unsigned;
927  int flags;
928 } __Pyx_TypeInfo;
929 typedef struct __Pyx_StructField_ {
930  __Pyx_TypeInfo* type;
931  const char* name;
932  size_t offset;
933 } __Pyx_StructField;
934 typedef struct {
935  __Pyx_StructField* field;
936  size_t parent_offset;
937 } __Pyx_BufFmt_StackElem;
938 typedef struct {
939  __Pyx_StructField root;
940  __Pyx_BufFmt_StackElem* head;
941  size_t fmt_offset;
942  size_t new_count, enc_count;
943  size_t struct_alignment;
944  int is_complex;
945  char enc_type;
946  char new_packmode;
947  char enc_packmode;
948  char is_valid_array;
949 } __Pyx_BufFmt_Context;
950 
951 
952 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
953  * # in Cython to enable them only on the right systems.
954  *
955  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
956  * ctypedef npy_int16 int16_t
957  * ctypedef npy_int32 int32_t
958  */
959 typedef npy_int8 __pyx_t_5numpy_int8_t;
960 
961 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
962  *
963  * ctypedef npy_int8 int8_t
964  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
965  * ctypedef npy_int32 int32_t
966  * ctypedef npy_int64 int64_t
967  */
968 typedef npy_int16 __pyx_t_5numpy_int16_t;
969 
970 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
971  * ctypedef npy_int8 int8_t
972  * ctypedef npy_int16 int16_t
973  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
974  * ctypedef npy_int64 int64_t
975  * #ctypedef npy_int96 int96_t
976  */
977 typedef npy_int32 __pyx_t_5numpy_int32_t;
978 
979 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
980  * ctypedef npy_int16 int16_t
981  * ctypedef npy_int32 int32_t
982  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
983  * #ctypedef npy_int96 int96_t
984  * #ctypedef npy_int128 int128_t
985  */
986 typedef npy_int64 __pyx_t_5numpy_int64_t;
987 
988 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
989  * #ctypedef npy_int128 int128_t
990  *
991  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
992  * ctypedef npy_uint16 uint16_t
993  * ctypedef npy_uint32 uint32_t
994  */
995 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
996 
997 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
998  *
999  * ctypedef npy_uint8 uint8_t
1000  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1001  * ctypedef npy_uint32 uint32_t
1002  * ctypedef npy_uint64 uint64_t
1003  */
1004 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1005 
1006 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
1007  * ctypedef npy_uint8 uint8_t
1008  * ctypedef npy_uint16 uint16_t
1009  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1010  * ctypedef npy_uint64 uint64_t
1011  * #ctypedef npy_uint96 uint96_t
1012  */
1013 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1014 
1015 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":786
1016  * ctypedef npy_uint16 uint16_t
1017  * ctypedef npy_uint32 uint32_t
1018  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1019  * #ctypedef npy_uint96 uint96_t
1020  * #ctypedef npy_uint128 uint128_t
1021  */
1022 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1023 
1024 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
1025  * #ctypedef npy_uint128 uint128_t
1026  *
1027  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1028  * ctypedef npy_float64 float64_t
1029  * #ctypedef npy_float80 float80_t
1030  */
1031 typedef npy_float32 __pyx_t_5numpy_float32_t;
1032 
1033 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
1034  *
1035  * ctypedef npy_float32 float32_t
1036  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1037  * #ctypedef npy_float80 float80_t
1038  * #ctypedef npy_float128 float128_t
1039  */
1040 typedef npy_float64 __pyx_t_5numpy_float64_t;
1041 
1042 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":800
1043  * # The int types are mapped a bit surprising --
1044  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1045  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1046  * ctypedef npy_longlong long_t
1047  * ctypedef npy_longlong longlong_t
1048  */
1049 typedef npy_long __pyx_t_5numpy_int_t;
1050 
1051 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
1052  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1053  * ctypedef npy_long int_t
1054  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1055  * ctypedef npy_longlong longlong_t
1056  *
1057  */
1058 typedef npy_longlong __pyx_t_5numpy_long_t;
1059 
1060 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
1061  * ctypedef npy_long int_t
1062  * ctypedef npy_longlong long_t
1063  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1064  *
1065  * ctypedef npy_ulong uint_t
1066  */
1067 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1068 
1069 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":804
1070  * ctypedef npy_longlong longlong_t
1071  *
1072  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1073  * ctypedef npy_ulonglong ulong_t
1074  * ctypedef npy_ulonglong ulonglong_t
1075  */
1076 typedef npy_ulong __pyx_t_5numpy_uint_t;
1077 
1078 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
1079  *
1080  * ctypedef npy_ulong uint_t
1081  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1082  * ctypedef npy_ulonglong ulonglong_t
1083  *
1084  */
1085 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1086 
1087 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":806
1088  * ctypedef npy_ulong uint_t
1089  * ctypedef npy_ulonglong ulong_t
1090  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1091  *
1092  * ctypedef npy_intp intp_t
1093  */
1094 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1095 
1096 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":808
1097  * ctypedef npy_ulonglong ulonglong_t
1098  *
1099  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1100  * ctypedef npy_uintp uintp_t
1101  *
1102  */
1103 typedef npy_intp __pyx_t_5numpy_intp_t;
1104 
1105 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
1106  *
1107  * ctypedef npy_intp intp_t
1108  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1109  *
1110  * ctypedef npy_double float_t
1111  */
1112 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1113 
1114 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":811
1115  * ctypedef npy_uintp uintp_t
1116  *
1117  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1118  * ctypedef npy_double double_t
1119  * ctypedef npy_longdouble longdouble_t
1120  */
1121 typedef npy_double __pyx_t_5numpy_float_t;
1122 
1123 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
1124  *
1125  * ctypedef npy_double float_t
1126  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1127  * ctypedef npy_longdouble longdouble_t
1128  *
1129  */
1130 typedef npy_double __pyx_t_5numpy_double_t;
1131 
1132 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
1133  * ctypedef npy_double float_t
1134  * ctypedef npy_double double_t
1135  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1136  *
1137  * ctypedef npy_cfloat cfloat_t
1138  */
1139 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1140 
1141 /* "csmoothers.pxd":3
1142  * from proteus cimport superluWrappers
1143  *
1144  * ctypedef int PROTEUS_LAPACK_INTEGER # <<<<<<<<<<<<<<
1145  * # ARB - the compiler macro does not seem to be picking this up...
1146  * ctypedef double [:] DDATA
1147  */
1148 typedef int __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER;
1149 /* Declarations.proto */
1150 #if CYTHON_CCOMPLEX
1151  #ifdef __cplusplus
1152  typedef ::std::complex< float > __pyx_t_float_complex;
1153  #else
1154  typedef float _Complex __pyx_t_float_complex;
1155  #endif
1156 #else
1157  typedef struct { float real, imag; } __pyx_t_float_complex;
1158 #endif
1159 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1160 
1161 /* Declarations.proto */
1162 #if CYTHON_CCOMPLEX
1163  #ifdef __cplusplus
1164  typedef ::std::complex< double > __pyx_t_double_complex;
1165  #else
1166  typedef double _Complex __pyx_t_double_complex;
1167  #endif
1168 #else
1169  typedef struct { double real, imag; } __pyx_t_double_complex;
1170 #endif
1171 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1172 
1173 
1174 /*--- Type declarations ---*/
1175 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix;
1176 struct __pyx_obj_10csmoothers_cASMFactor;
1177 struct __pyx_obj_10csmoothers_cBASMFactor;
1178 struct __pyx_array_obj;
1179 struct __pyx_MemviewEnum_obj;
1180 struct __pyx_memoryview_obj;
1181 struct __pyx_memoryviewslice_obj;
1182 
1183 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
1184  * ctypedef npy_longdouble longdouble_t
1185  *
1186  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1187  * ctypedef npy_cdouble cdouble_t
1188  * ctypedef npy_clongdouble clongdouble_t
1189  */
1190 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1191 
1192 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
1193  *
1194  * ctypedef npy_cfloat cfloat_t
1195  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1196  * ctypedef npy_clongdouble clongdouble_t
1197  *
1198  */
1199 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1200 
1201 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":817
1202  * ctypedef npy_cfloat cfloat_t
1203  * ctypedef npy_cdouble cdouble_t
1204  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1205  *
1206  * ctypedef npy_cdouble complex_t
1207  */
1208 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1209 
1210 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":819
1211  * ctypedef npy_clongdouble clongdouble_t
1212  *
1213  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1214  *
1215  * cdef inline object PyArray_MultiIterNew1(a):
1216  */
1217 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1218 struct __pyx_t_7proteus_15superluWrappers__NRformat;
1219 
1220 /* "superluWrappers.pxd":61
1221  * void csp_preorder "sp_preorder"(_superlu_options_t *, _SuperMatrix *, int *, int *, _SuperMatrix *)
1222  *
1223  * cdef struct _NRformat: # <<<<<<<<<<<<<<
1224  * np.int32_t nnz
1225  * np.float64_t * nzval
1226  */
1227 struct __pyx_t_7proteus_15superluWrappers__NRformat {
1228  __pyx_t_5numpy_int32_t nnz;
1229  __pyx_t_5numpy_float64_t *nzval;
1230  __pyx_t_5numpy_int32_t *colind;
1231  __pyx_t_5numpy_int32_t *rowptr;
1232 };
1233 
1234 /* "csmoothers.pxd":5
1235  * ctypedef int PROTEUS_LAPACK_INTEGER
1236  * # ARB - the compiler macro does not seem to be picking this up...
1237  * ctypedef double [:] DDATA # <<<<<<<<<<<<<<
1238  * ctypedef int [:] IDATA
1239  * ctypedef superluWrappers._SuperMatrix SuperMatrix
1240  */
1241 typedef __Pyx_memviewslice __pyx_t_10csmoothers_DDATA;
1242 
1243 /* "csmoothers.pxd":6
1244  * # ARB - the compiler macro does not seem to be picking this up...
1245  * ctypedef double [:] DDATA
1246  * ctypedef int [:] IDATA # <<<<<<<<<<<<<<
1247  * ctypedef superluWrappers._SuperMatrix SuperMatrix
1248  *
1249  */
1250 typedef __Pyx_memviewslice __pyx_t_10csmoothers_IDATA;
1251 
1252 /* "csmoothers.pxd":7
1253  * ctypedef double [:] DDATA
1254  * ctypedef int [:] IDATA
1255  * ctypedef superluWrappers._SuperMatrix SuperMatrix # <<<<<<<<<<<<<<
1256  *
1257  * cdef extern from "smoothers.h":
1258  */
1259 typedef SuperMatrix __pyx_t_10csmoothers_SuperMatrix;
1260 
1261 /* "superluWrappers.pxd":67
1262  * np.int32_t * rowptr
1263  *
1264  * cdef class cSparseMatrix(object): # <<<<<<<<<<<<<<
1265  * cdef np.int32_t dim[2]
1266  * cdef _NRformat A
1267  */
1268 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix {
1269  PyObject_HEAD
1270  __pyx_t_5numpy_int32_t dim[2];
1271  struct __pyx_t_7proteus_15superluWrappers__NRformat A;
1272 };
1273 
1274 
1275 /* "csmoothers.pxd":25
1276  * void cbasm_NR_solve "basm_NR_solve"(int rowBlocks, int N, superluWrappers._SuperMatrix *A, double w, double** subdomainL, int* subdomain_dim, int** l2g_L, double* R, double** subdomainR, int* node_order, double** subdomain_dX, double* dX, PROTEUS_LAPACK_INTEGER** subdomainPivots, PROTEUS_LAPACK_INTEGER** subdomainColPivots)
1277  *
1278  * cdef class cASMFactor(object): # <<<<<<<<<<<<<<
1279  * cdef int N
1280  * cdef int *subdomain_dim
1281  */
1282 struct __pyx_obj_10csmoothers_cASMFactor {
1283  PyObject_HEAD
1284  int N;
1285  int *subdomain_dim;
1286  int **l2g_L;
1287  double **subdomain_L;
1288  double **subdomain_R;
1289  double **subdomain_dX;
1290  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1291 };
1292 
1293 
1294 /* "csmoothers.pxd":34
1295  * cdef PROTEUS_LAPACK_INTEGER **subdomain_pivots
1296  *
1297  * cdef class cBASMFactor(object): # <<<<<<<<<<<<<<
1298  * cdef int N
1299  * cdef int bs
1300  */
1301 struct __pyx_obj_10csmoothers_cBASMFactor {
1302  PyObject_HEAD
1303  int N;
1304  int bs;
1305  int *subdomain_dim;
1306  int **l2g_L;
1307  double **subdomain_L;
1308  double **subdomain_R;
1309  double **subdomain_dX;
1310  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1311  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_col_pivots;
1312 };
1313 
1314 
1315 /* "View.MemoryView":105
1316  *
1317  * @cname("__pyx_array")
1318  * cdef class array: # <<<<<<<<<<<<<<
1319  *
1320  * cdef:
1321  */
1322 struct __pyx_array_obj {
1323  PyObject_HEAD
1324  struct __pyx_vtabstruct_array *__pyx_vtab;
1325  char *data;
1326  Py_ssize_t len;
1327  char *format;
1328  int ndim;
1329  Py_ssize_t *_shape;
1330  Py_ssize_t *_strides;
1331  Py_ssize_t itemsize;
1332  PyObject *mode;
1333  PyObject *_format;
1334  void (*callback_free_data)(void *);
1335  int free_data;
1336  int dtype_is_object;
1337 };
1338 
1339 
1340 /* "View.MemoryView":279
1341  *
1342  * @cname('__pyx_MemviewEnum')
1343  * cdef class Enum(object): # <<<<<<<<<<<<<<
1344  * cdef object name
1345  * def __init__(self, name):
1346  */
1347 struct __pyx_MemviewEnum_obj {
1348  PyObject_HEAD
1349  PyObject *name;
1350 };
1351 
1352 
1353 /* "View.MemoryView":330
1354  *
1355  * @cname('__pyx_memoryview')
1356  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1357  *
1358  * cdef object obj
1359  */
1360 struct __pyx_memoryview_obj {
1361  PyObject_HEAD
1362  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1363  PyObject *obj;
1364  PyObject *_size;
1365  PyObject *_array_interface;
1366  PyThread_type_lock lock;
1367  __pyx_atomic_int acquisition_count[2];
1368  __pyx_atomic_int *acquisition_count_aligned_p;
1369  Py_buffer view;
1370  int flags;
1371  int dtype_is_object;
1372  __Pyx_TypeInfo *typeinfo;
1373 };
1374 
1375 
1376 /* "View.MemoryView":965
1377  *
1378  * @cname('__pyx_memoryviewslice')
1379  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1380  * "Internal class for passing memoryview slices to Python"
1381  *
1382  */
1383 struct __pyx_memoryviewslice_obj {
1384  struct __pyx_memoryview_obj __pyx_base;
1385  __Pyx_memviewslice from_slice;
1386  PyObject *from_object;
1387  PyObject *(*to_object_func)(char *);
1388  int (*to_dtype_func)(char *, PyObject *);
1389 };
1390 
1391 
1392 
1393 /* "View.MemoryView":105
1394  *
1395  * @cname("__pyx_array")
1396  * cdef class array: # <<<<<<<<<<<<<<
1397  *
1398  * cdef:
1399  */
1400 
1401 struct __pyx_vtabstruct_array {
1402  PyObject *(*get_memview)(struct __pyx_array_obj *);
1403 };
1404 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1405 
1406 
1407 /* "View.MemoryView":330
1408  *
1409  * @cname('__pyx_memoryview')
1410  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1411  *
1412  * cdef object obj
1413  */
1414 
1415 struct __pyx_vtabstruct_memoryview {
1416  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1417  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1418  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1419  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1420  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1421  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1422  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1423 };
1424 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1425 
1426 
1427 /* "View.MemoryView":965
1428  *
1429  * @cname('__pyx_memoryviewslice')
1430  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1431  * "Internal class for passing memoryview slices to Python"
1432  *
1433  */
1434 
1435 struct __pyx_vtabstruct__memoryviewslice {
1436  struct __pyx_vtabstruct_memoryview __pyx_base;
1437 };
1438 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1439 
1440 /* --- Runtime support code (head) --- */
1441 /* Refnanny.proto */
1442 #ifndef CYTHON_REFNANNY
1443  #define CYTHON_REFNANNY 0
1444 #endif
1445 #if CYTHON_REFNANNY
1446  typedef struct {
1447  void (*INCREF)(void*, PyObject*, int);
1448  void (*DECREF)(void*, PyObject*, int);
1449  void (*GOTREF)(void*, PyObject*, int);
1450  void (*GIVEREF)(void*, PyObject*, int);
1451  void* (*SetupContext)(const char*, int, const char*);
1452  void (*FinishContext)(void**);
1453  } __Pyx_RefNannyAPIStruct;
1454  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1455  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1456  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1457 #ifdef WITH_THREAD
1458  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1459  if (acquire_gil) {\
1460  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1461  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1462  PyGILState_Release(__pyx_gilstate_save);\
1463  } else {\
1464  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1465  }
1466 #else
1467  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1468  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1469 #endif
1470  #define __Pyx_RefNannyFinishContext()\
1471  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1472  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1473  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1474  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1475  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1476  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1477  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1478  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1479  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1480 #else
1481  #define __Pyx_RefNannyDeclarations
1482  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1483  #define __Pyx_RefNannyFinishContext()
1484  #define __Pyx_INCREF(r) Py_INCREF(r)
1485  #define __Pyx_DECREF(r) Py_DECREF(r)
1486  #define __Pyx_GOTREF(r)
1487  #define __Pyx_GIVEREF(r)
1488  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1489  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1490  #define __Pyx_XGOTREF(r)
1491  #define __Pyx_XGIVEREF(r)
1492 #endif
1493 #define __Pyx_XDECREF_SET(r, v) do {\
1494  PyObject *tmp = (PyObject *) r;\
1495  r = v; __Pyx_XDECREF(tmp);\
1496  } while (0)
1497 #define __Pyx_DECREF_SET(r, v) do {\
1498  PyObject *tmp = (PyObject *) r;\
1499  r = v; __Pyx_DECREF(tmp);\
1500  } while (0)
1501 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1502 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1503 
1504 /* PyObjectGetAttrStr.proto */
1505 #if CYTHON_USE_TYPE_SLOTS
1506 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1507 #else
1508 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1509 #endif
1510 
1511 /* GetBuiltinName.proto */
1512 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1513 
1514 /* RaiseArgTupleInvalid.proto */
1515 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1516  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1517 
1518 /* RaiseDoubleKeywords.proto */
1519 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1520 
1521 /* ParseKeywords.proto */
1522 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1523  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1524  const char* function_name);
1525 
1526 /* PyObjectSetAttrStr.proto */
1527 #if CYTHON_USE_TYPE_SLOTS
1528 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1529 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1530 #else
1531 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1532 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1533 #endif
1534 
1535 /* PyCFunctionFastCall.proto */
1536 #if CYTHON_FAST_PYCCALL
1537 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1538 #else
1539 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1540 #endif
1541 
1542 /* PyFunctionFastCall.proto */
1543 #if CYTHON_FAST_PYCALL
1544 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1545  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1546 #if 1 || PY_VERSION_HEX < 0x030600B1
1547 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1548 #else
1549 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1550 #endif
1551 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1552  (sizeof(char [1 - 2*!(cond)]) - 1)
1553 #ifndef Py_MEMBER_SIZE
1554 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1555 #endif
1556  static size_t __pyx_pyframe_localsplus_offset = 0;
1557  #include "frameobject.h"
1558  #define __Pxy_PyFrame_Initialize_Offsets()\
1559  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1560  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1561  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1562  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1563 #endif
1564 
1565 /* PyObjectCall.proto */
1566 #if CYTHON_COMPILING_IN_CPYTHON
1567 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1568 #else
1569 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1570 #endif
1571 
1572 /* PyObjectCallMethO.proto */
1573 #if CYTHON_COMPILING_IN_CPYTHON
1574 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1575 #endif
1576 
1577 /* PyObjectCallOneArg.proto */
1578 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1579 
1580 /* ArgTypeTest.proto */
1581 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1582  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1583  __Pyx__ArgTypeTest(obj, type, name, exact))
1584 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1585 
1586 /* PyThreadStateGet.proto */
1587 #if CYTHON_FAST_THREAD_STATE
1588 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1589 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1590 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1591 #else
1592 #define __Pyx_PyThreadState_declare
1593 #define __Pyx_PyThreadState_assign
1594 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1595 #endif
1596 
1597 /* PyErrFetchRestore.proto */
1598 #if CYTHON_FAST_THREAD_STATE
1599 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1600 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1601 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1602 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1603 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1604 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1605 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1606 #if CYTHON_COMPILING_IN_CPYTHON
1607 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1608 #else
1609 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1610 #endif
1611 #else
1612 #define __Pyx_PyErr_Clear() PyErr_Clear()
1613 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1614 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1615 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1616 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1617 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1618 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1619 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1620 #endif
1621 
1622 /* RaiseException.proto */
1623 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1624 
1625 /* ExtTypeTest.proto */
1626 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1627 
1628 /* MemviewSliceInit.proto */
1629 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1630 #define __Pyx_MEMVIEW_DIRECT 1
1631 #define __Pyx_MEMVIEW_PTR 2
1632 #define __Pyx_MEMVIEW_FULL 4
1633 #define __Pyx_MEMVIEW_CONTIG 8
1634 #define __Pyx_MEMVIEW_STRIDED 16
1635 #define __Pyx_MEMVIEW_FOLLOW 32
1636 #define __Pyx_IS_C_CONTIG 1
1637 #define __Pyx_IS_F_CONTIG 2
1638 static int __Pyx_init_memviewslice(
1639  struct __pyx_memoryview_obj *memview,
1640  int ndim,
1641  __Pyx_memviewslice *memviewslice,
1642  int memview_is_new_reference);
1643 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1644  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1645 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1646  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1647 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1648 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1649 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1650 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1651 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1652 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1653 
1654 /* BufferIndexError.proto */
1655 static void __Pyx_RaiseBufferIndexError(int axis);
1656 
1657 /* WriteUnraisableException.proto */
1658 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1659  int lineno, const char *filename,
1660  int full_traceback, int nogil);
1661 
1662 /* DictGetItem.proto */
1663 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1664 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1665 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1666  (likely(PyDict_CheckExact(obj)) ?\
1667  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1668 #else
1669 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1670 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1671 #endif
1672 
1673 /* RaiseTooManyValuesToUnpack.proto */
1674 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1675 
1676 /* RaiseNeedMoreValuesToUnpack.proto */
1677 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1678 
1679 /* RaiseNoneIterError.proto */
1680 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1681 
1682 /* GetTopmostException.proto */
1683 #if CYTHON_USE_EXC_INFO_STACK
1684 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1685 #endif
1686 
1687 /* SaveResetException.proto */
1688 #if CYTHON_FAST_THREAD_STATE
1689 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1690 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1691 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1692 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1693 #else
1694 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1695 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1696 #endif
1697 
1698 /* PyErrExceptionMatches.proto */
1699 #if CYTHON_FAST_THREAD_STATE
1700 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1701 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1702 #else
1703 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1704 #endif
1705 
1706 /* GetException.proto */
1707 #if CYTHON_FAST_THREAD_STATE
1708 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1709 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1710 #else
1711 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1712 #endif
1713 
1714 /* PyObjectCall2Args.proto */
1715 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1716 
1717 /* IncludeStringH.proto */
1718 #include <string.h>
1719 
1720 /* BytesEquals.proto */
1721 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1722 
1723 /* UnicodeEquals.proto */
1724 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1725 
1726 /* StrEquals.proto */
1727 #if PY_MAJOR_VERSION >= 3
1728 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1729 #else
1730 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1731 #endif
1732 
1733 /* None.proto */
1734 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1735 
1736 /* UnaryNegOverflows.proto */
1737 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1738  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1739 
1740 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1741 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1742 /* GetAttr.proto */
1743 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1744 
1745 /* GetItemInt.proto */
1746 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1747  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1748  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1749  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1750  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1751 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1752  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1753  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1754  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1755 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1756  int wraparound, int boundscheck);
1757 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1758  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1759  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1760  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1761 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1762  int wraparound, int boundscheck);
1763 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1764 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1765  int is_list, int wraparound, int boundscheck);
1766 
1767 /* ObjectGetItem.proto */
1768 #if CYTHON_USE_TYPE_SLOTS
1769 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1770 #else
1771 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1772 #endif
1773 
1774 /* decode_c_string_utf16.proto */
1775 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1776  int byteorder = 0;
1777  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1778 }
1779 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1780  int byteorder = -1;
1781  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1782 }
1783 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1784  int byteorder = 1;
1785  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1786 }
1787 
1788 /* decode_c_string.proto */
1789 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1790  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1791  const char* encoding, const char* errors,
1792  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1793 
1794 /* GetAttr3.proto */
1795 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1796 
1797 /* PyDictVersioning.proto */
1798 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1799 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1800 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1801 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1802  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1803  (cache_var) = (value);
1804 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1805  static PY_UINT64_T __pyx_dict_version = 0;\
1806  static PyObject *__pyx_dict_cached_value = NULL;\
1807  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1808  (VAR) = __pyx_dict_cached_value;\
1809  } else {\
1810  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1811  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1812  }\
1813 }
1814 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1815 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1816 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1817 #else
1818 #define __PYX_GET_DICT_VERSION(dict) (0)
1819 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1820 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1821 #endif
1822 
1823 /* GetModuleGlobalName.proto */
1824 #if CYTHON_USE_DICT_VERSIONS
1825 #define __Pyx_GetModuleGlobalName(var, name) {\
1826  static PY_UINT64_T __pyx_dict_version = 0;\
1827  static PyObject *__pyx_dict_cached_value = NULL;\
1828  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1829  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1830  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1831 }
1832 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1833  PY_UINT64_T __pyx_dict_version;\
1834  PyObject *__pyx_dict_cached_value;\
1835  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1836 }
1837 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1838 #else
1839 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1840 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1841 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1842 #endif
1843 
1844 /* SwapException.proto */
1845 #if CYTHON_FAST_THREAD_STATE
1846 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1847 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1848 #else
1849 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1850 #endif
1851 
1852 /* Import.proto */
1853 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1854 
1855 /* FastTypeChecks.proto */
1856 #if CYTHON_COMPILING_IN_CPYTHON
1857 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1858 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1859 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1860 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1861 #else
1862 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1863 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1864 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1865 #endif
1866 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1867 
1868 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1869 /* ListCompAppend.proto */
1870 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1871 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1872  PyListObject* L = (PyListObject*) list;
1873  Py_ssize_t len = Py_SIZE(list);
1874  if (likely(L->allocated > len)) {
1875  Py_INCREF(x);
1876  PyList_SET_ITEM(list, len, x);
1877  Py_SIZE(list) = len+1;
1878  return 0;
1879  }
1880  return PyList_Append(list, x);
1881 }
1882 #else
1883 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1884 #endif
1885 
1886 /* PyIntBinop.proto */
1887 #if !CYTHON_COMPILING_IN_PYPY
1888 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1889 #else
1890 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1891  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1892 #endif
1893 
1894 /* ListExtend.proto */
1895 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1896 #if CYTHON_COMPILING_IN_CPYTHON
1897  PyObject* none = _PyList_Extend((PyListObject*)L, v);
1898  if (unlikely(!none))
1899  return -1;
1900  Py_DECREF(none);
1901  return 0;
1902 #else
1903  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1904 #endif
1905 }
1906 
1907 /* ListAppend.proto */
1908 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1909 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1910  PyListObject* L = (PyListObject*) list;
1911  Py_ssize_t len = Py_SIZE(list);
1912  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1913  Py_INCREF(x);
1914  PyList_SET_ITEM(list, len, x);
1915  Py_SIZE(list) = len+1;
1916  return 0;
1917  }
1918  return PyList_Append(list, x);
1919 }
1920 #else
1921 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1922 #endif
1923 
1924 /* None.proto */
1925 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1926 
1927 /* None.proto */
1928 static CYTHON_INLINE long __Pyx_div_long(long, long);
1929 
1930 /* ImportFrom.proto */
1931 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1932 
1933 /* HasAttr.proto */
1934 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1935 
1936 /* PyObject_GenericGetAttrNoDict.proto */
1937 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1938 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1939 #else
1940 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1941 #endif
1942 
1943 /* PyObject_GenericGetAttr.proto */
1944 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1945 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1946 #else
1947 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1948 #endif
1949 
1950 /* SetupReduce.proto */
1951 static int __Pyx_setup_reduce(PyObject* type_obj);
1952 
1953 /* SetVTable.proto */
1954 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1955 
1956 /* TypeImport.proto */
1957 #ifndef __PYX_HAVE_RT_ImportType_proto
1958 #define __PYX_HAVE_RT_ImportType_proto
1959 enum __Pyx_ImportType_CheckSize {
1960  __Pyx_ImportType_CheckSize_Error = 0,
1961  __Pyx_ImportType_CheckSize_Warn = 1,
1962  __Pyx_ImportType_CheckSize_Ignore = 2
1963 };
1964 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1965 #endif
1966 
1967 /* CalculateMetaclass.proto */
1968 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1969 
1970 /* FetchCommonType.proto */
1971 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1972 
1973 /* CythonFunction.proto */
1974 #define __Pyx_CyFunction_USED 1
1975 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1976 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1977 #define __Pyx_CYFUNCTION_CCLASS 0x04
1978 #define __Pyx_CyFunction_GetClosure(f)\
1979  (((__pyx_CyFunctionObject *) (f))->func_closure)
1980 #define __Pyx_CyFunction_GetClassObj(f)\
1981  (((__pyx_CyFunctionObject *) (f))->func_classobj)
1982 #define __Pyx_CyFunction_Defaults(type, f)\
1983  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1984 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1985  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1986 typedef struct {
1987  PyCFunctionObject func;
1988 #if PY_VERSION_HEX < 0x030500A0
1989  PyObject *func_weakreflist;
1990 #endif
1991  PyObject *func_dict;
1992  PyObject *func_name;
1993  PyObject *func_qualname;
1994  PyObject *func_doc;
1995  PyObject *func_globals;
1996  PyObject *func_code;
1997  PyObject *func_closure;
1998  PyObject *func_classobj;
1999  void *defaults;
2000  int defaults_pyobjects;
2001  size_t defaults_size; // used by FusedFunction for copying defaults
2002  int flags;
2003  PyObject *defaults_tuple;
2004  PyObject *defaults_kwdict;
2005  PyObject *(*defaults_getter)(PyObject *);
2006  PyObject *func_annotations;
2007 } __pyx_CyFunctionObject;
2008 static PyTypeObject *__pyx_CyFunctionType = 0;
2009 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2010 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
2011  __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
2012 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
2013  int flags, PyObject* qualname,
2014  PyObject *self,
2015  PyObject *module, PyObject *globals,
2016  PyObject* code);
2017 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2018  size_t size,
2019  int pyobjects);
2020 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2021  PyObject *tuple);
2022 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2023  PyObject *dict);
2024 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2025  PyObject *dict);
2026 static int __pyx_CyFunction_init(void);
2027 
2028 /* SetNameInClass.proto */
2029 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2030 #define __Pyx_SetNameInClass(ns, name, value)\
2031  (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2032 #elif CYTHON_COMPILING_IN_CPYTHON
2033 #define __Pyx_SetNameInClass(ns, name, value)\
2034  (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2035 #else
2036 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2037 #endif
2038 
2039 /* Py3ClassCreate.proto */
2040 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2041  PyObject *mkw, PyObject *modname, PyObject *doc);
2042 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2043  PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
2044 
2045 /* CLineInTraceback.proto */
2046 #ifdef CYTHON_CLINE_IN_TRACEBACK
2047 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2048 #else
2049 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2050 #endif
2051 
2052 /* CodeObjectCache.proto */
2053 typedef struct {
2054  PyCodeObject* code_object;
2055  int code_line;
2056 } __Pyx_CodeObjectCacheEntry;
2057 struct __Pyx_CodeObjectCache {
2058  int count;
2059  int max_count;
2060  __Pyx_CodeObjectCacheEntry* entries;
2061 };
2062 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2063 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2064 static PyCodeObject *__pyx_find_code_object(int code_line);
2065 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2066 
2067 /* AddTraceback.proto */
2068 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2069  int py_line, const char *filename);
2070 
2071 #if PY_MAJOR_VERSION < 3
2072  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2073  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2074 #else
2075  #define __Pyx_GetBuffer PyObject_GetBuffer
2076  #define __Pyx_ReleaseBuffer PyBuffer_Release
2077 #endif
2078 
2079 
2080 /* BufferStructDeclare.proto */
2081 typedef struct {
2082  Py_ssize_t shape, strides, suboffsets;
2083 } __Pyx_Buf_DimInfo;
2084 typedef struct {
2085  size_t refcount;
2086  Py_buffer pybuffer;
2087 } __Pyx_Buffer;
2088 typedef struct {
2089  __Pyx_Buffer *rcbuffer;
2090  char *data;
2091  __Pyx_Buf_DimInfo diminfo[8];
2092 } __Pyx_LocalBuf_ND;
2093 
2094 /* MemviewSliceIsContig.proto */
2095 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2096 
2097 /* OverlappingSlices.proto */
2098 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2099  __Pyx_memviewslice *slice2,
2100  int ndim, size_t itemsize);
2101 
2102 /* Capsule.proto */
2103 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2104 
2105 /* RealImag.proto */
2106 #if CYTHON_CCOMPLEX
2107  #ifdef __cplusplus
2108  #define __Pyx_CREAL(z) ((z).real())
2109  #define __Pyx_CIMAG(z) ((z).imag())
2110  #else
2111  #define __Pyx_CREAL(z) (__real__(z))
2112  #define __Pyx_CIMAG(z) (__imag__(z))
2113  #endif
2114 #else
2115  #define __Pyx_CREAL(z) ((z).real)
2116  #define __Pyx_CIMAG(z) ((z).imag)
2117 #endif
2118 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2119  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2120  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2121  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2122 #else
2123  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2124  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2125 #endif
2126 
2127 /* Arithmetic.proto */
2128 #if CYTHON_CCOMPLEX
2129  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2130  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2131  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2132  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2133  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2134  #define __Pyx_c_neg_float(a) (-(a))
2135  #ifdef __cplusplus
2136  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2137  #define __Pyx_c_conj_float(z) (::std::conj(z))
2138  #if 1
2139  #define __Pyx_c_abs_float(z) (::std::abs(z))
2140  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2141  #endif
2142  #else
2143  #define __Pyx_c_is_zero_float(z) ((z)==0)
2144  #define __Pyx_c_conj_float(z) (conjf(z))
2145  #if 1
2146  #define __Pyx_c_abs_float(z) (cabsf(z))
2147  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2148  #endif
2149  #endif
2150 #else
2151  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2152  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2153  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2154  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2155  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2156  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2157  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2158  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2159  #if 1
2160  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2161  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2162  #endif
2163 #endif
2164 
2165 /* Arithmetic.proto */
2166 #if CYTHON_CCOMPLEX
2167  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2168  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2169  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2170  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2171  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2172  #define __Pyx_c_neg_double(a) (-(a))
2173  #ifdef __cplusplus
2174  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2175  #define __Pyx_c_conj_double(z) (::std::conj(z))
2176  #if 1
2177  #define __Pyx_c_abs_double(z) (::std::abs(z))
2178  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2179  #endif
2180  #else
2181  #define __Pyx_c_is_zero_double(z) ((z)==0)
2182  #define __Pyx_c_conj_double(z) (conj(z))
2183  #if 1
2184  #define __Pyx_c_abs_double(z) (cabs(z))
2185  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2186  #endif
2187  #endif
2188 #else
2189  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2190  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2191  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2192  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2193  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2194  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2195  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2196  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2197  #if 1
2198  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2199  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2200  #endif
2201 #endif
2202 
2203 /* CIntToPy.proto */
2204 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2205 
2206 /* CIntToPy.proto */
2207 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2208 
2209 /* MemviewSliceCopyTemplate.proto */
2210 static __Pyx_memviewslice
2211 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2212  const char *mode, int ndim,
2213  size_t sizeof_dtype, int contig_flag,
2214  int dtype_is_object);
2215 
2216 /* CIntFromPy.proto */
2217 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2218 
2219 /* CIntFromPy.proto */
2220 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2221 
2222 /* CIntToPy.proto */
2223 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2224 
2225 /* CIntFromPy.proto */
2226 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2227 
2228 /* IsLittleEndian.proto */
2229 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2230 
2231 /* BufferFormatCheck.proto */
2232 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2233 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2234  __Pyx_BufFmt_StackElem* stack,
2235  __Pyx_TypeInfo* type);
2236 
2237 /* TypeInfoCompare.proto */
2238 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2239 
2240 /* MemviewSliceValidateAndInit.proto */
2241 static int __Pyx_ValidateAndInit_memviewslice(
2242  int *axes_specs,
2243  int c_or_f_flag,
2244  int buf_flags,
2245  int ndim,
2246  __Pyx_TypeInfo *dtype,
2247  __Pyx_BufFmt_StackElem stack[],
2248  __Pyx_memviewslice *memviewslice,
2249  PyObject *original_obj);
2250 
2251 /* ObjectToMemviewSlice.proto */
2252 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2253 
2254 /* ObjectToMemviewSlice.proto */
2255 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2256 
2257 /* CheckBinaryVersion.proto */
2258 static int __Pyx_check_binary_version(void);
2259 
2260 /* InitStrings.proto */
2261 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2262 
2263 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2264 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2265 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2266 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2267 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2268 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2269 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2270 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2271 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2272 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2273 
2274 /* Module declarations from 'proteus' */
2275 
2276 /* Module declarations from 'cpython.buffer' */
2277 
2278 /* Module declarations from 'libc.string' */
2279 
2280 /* Module declarations from 'libc.stdio' */
2281 
2282 /* Module declarations from '__builtin__' */
2283 
2284 /* Module declarations from 'cpython.type' */
2285 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2286 
2287 /* Module declarations from 'cpython' */
2288 
2289 /* Module declarations from 'cpython.object' */
2290 
2291 /* Module declarations from 'cpython.ref' */
2292 
2293 /* Module declarations from 'cpython.mem' */
2294 
2295 /* Module declarations from 'numpy' */
2296 
2297 /* Module declarations from 'numpy' */
2298 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2299 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2300 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2301 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2302 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2303 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2304 
2305 /* Module declarations from 'proteus.superluWrappers' */
2306 static PyTypeObject *__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = 0;
2307 
2308 /* Module declarations from 'cython.view' */
2309 
2310 /* Module declarations from 'cython' */
2311 
2312 /* Module declarations from 'csmoothers' */
2313 static PyTypeObject *__pyx_ptype_10csmoothers_cASMFactor = 0;
2314 static PyTypeObject *__pyx_ptype_10csmoothers_cBASMFactor = 0;
2315 static PyTypeObject *__pyx_array_type = 0;
2316 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2317 static PyTypeObject *__pyx_memoryview_type = 0;
2318 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2319 static PyObject *generic = 0;
2320 static PyObject *strided = 0;
2321 static PyObject *indirect = 0;
2322 static PyObject *contiguous = 0;
2323 static PyObject *indirect_contiguous = 0;
2324 static int __pyx_memoryview_thread_locks_used;
2325 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2326 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2327 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2328 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2329 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2330 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2331 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2332 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, struct __pyx_obj_10csmoothers_cASMFactor *); /*proto*/
2333 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, struct __pyx_obj_10csmoothers_cASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2334 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, struct __pyx_obj_10csmoothers_cBASMFactor *); /*proto*/
2335 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, struct __pyx_obj_10csmoothers_cBASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2336 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2337 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2338 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2339 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2340 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2341 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2342 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2343 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2344 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2345 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2346 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2347 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2348 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2349 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2350 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2351 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2352 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2353 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2354 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2355 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2356 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2357 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2358 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2359 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2360 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2361 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2362 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2363 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2364 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2365 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2366 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2367 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2368 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2369 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2370 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2371 #define __Pyx_MODULE_NAME "csmoothers"
2372 extern int __pyx_module_is_main_csmoothers;
2373 int __pyx_module_is_main_csmoothers = 0;
2374 
2375 /* Implementation of 'csmoothers' */
2376 static PyObject *__pyx_builtin_object;
2377 static PyObject *__pyx_builtin_TypeError;
2378 static PyObject *__pyx_builtin_ValueError;
2379 static PyObject *__pyx_builtin_range;
2380 static PyObject *__pyx_builtin_RuntimeError;
2381 static PyObject *__pyx_builtin_ImportError;
2382 static PyObject *__pyx_builtin_MemoryError;
2383 static PyObject *__pyx_builtin_enumerate;
2384 static PyObject *__pyx_builtin_Ellipsis;
2385 static PyObject *__pyx_builtin_id;
2386 static PyObject *__pyx_builtin_IndexError;
2387 static const char __pyx_k_A[] = "A";
2388 static const char __pyx_k_L[] = "L";
2389 static const char __pyx_k_M[] = "M";
2390 static const char __pyx_k_O[] = "O";
2391 static const char __pyx_k_R[] = "R";
2392 static const char __pyx_k_c[] = "c";
2393 static const char __pyx_k_w[] = "w";
2394 static const char __pyx_k_bs[] = "bs";
2395 static const char __pyx_k_dX[] = "dX";
2396 static const char __pyx_k_id[] = "id";
2397 static const char __pyx_k_nc[] = "nc";
2398 static const char __pyx_k_np[] = "np";
2399 static const char __pyx_k_nr[] = "nr";
2400 static const char __pyx_k_doc[] = "__doc__";
2401 static const char __pyx_k_new[] = "__new__";
2402 static const char __pyx_k_obj[] = "obj";
2403 static const char __pyx_k_tol[] = "tol";
2404 static const char __pyx_k_base[] = "base";
2405 static const char __pyx_k_dict[] = "__dict__";
2406 static const char __pyx_k_init[] = "__init__";
2407 static const char __pyx_k_main[] = "__main__";
2408 static const char __pyx_k_mode[] = "mode";
2409 static const char __pyx_k_name[] = "name";
2410 static const char __pyx_k_ndim[] = "ndim";
2411 static const char __pyx_k_pack[] = "pack";
2412 static const char __pyx_k_self[] = "self";
2413 static const char __pyx_k_size[] = "size";
2414 static const char __pyx_k_step[] = "step";
2415 static const char __pyx_k_stop[] = "stop";
2416 static const char __pyx_k_test[] = "__test__";
2417 static const char __pyx_k_ASCII[] = "ASCII";
2418 static const char __pyx_k_class[] = "__class__";
2419 static const char __pyx_k_error[] = "error";
2420 static const char __pyx_k_flags[] = "flags";
2421 static const char __pyx_k_numpy[] = "numpy";
2422 static const char __pyx_k_range[] = "range";
2423 static const char __pyx_k_shape[] = "shape";
2424 static const char __pyx_k_start[] = "start";
2425 static const char __pyx_k_encode[] = "encode";
2426 static const char __pyx_k_format[] = "format";
2427 static const char __pyx_k_import[] = "__import__";
2428 static const char __pyx_k_module[] = "__module__";
2429 static const char __pyx_k_name_2[] = "__name__";
2430 static const char __pyx_k_object[] = "object";
2431 static const char __pyx_k_pickle[] = "pickle";
2432 static const char __pyx_k_reduce[] = "__reduce__";
2433 static const char __pyx_k_struct[] = "struct";
2434 static const char __pyx_k_unpack[] = "unpack";
2435 static const char __pyx_k_update[] = "update";
2436 static const char __pyx_k_fortran[] = "fortran";
2437 static const char __pyx_k_memview[] = "memview";
2438 static const char __pyx_k_prepare[] = "__prepare__";
2439 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2440 static const char __pyx_k_getstate[] = "__getstate__";
2441 static const char __pyx_k_itemsize[] = "itemsize";
2442 static const char __pyx_k_pyx_type[] = "__pyx_type";
2443 static const char __pyx_k_qualname[] = "__qualname__";
2444 static const char __pyx_k_setstate[] = "__setstate__";
2445 static const char __pyx_k_ASMFactor[] = "ASMFactor";
2446 static const char __pyx_k_TypeError[] = "TypeError";
2447 static const char __pyx_k_asmFactor[] = "asmFactor";
2448 static const char __pyx_k_enumerate[] = "enumerate";
2449 static const char __pyx_k_metaclass[] = "__metaclass__";
2450 static const char __pyx_k_pyx_state[] = "__pyx_state";
2451 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2452 static const char __pyx_k_BASMFactor[] = "BASMFactor";
2453 static const char __pyx_k_IndexError[] = "IndexError";
2454 static const char __pyx_k_ValueError[] = "ValueError";
2455 static const char __pyx_k_basmFactor[] = "basmFactor";
2456 static const char __pyx_k_cASMFactor[] = "_cASMFactor";
2457 static const char __pyx_k_csmoothers[] = "csmoothers";
2458 static const char __pyx_k_node_order[] = "node_order";
2459 static const char __pyx_k_pyx_result[] = "__pyx_result";
2460 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2461 static const char __pyx_k_ImportError[] = "ImportError";
2462 static const char __pyx_k_MemoryError[] = "MemoryError";
2463 static const char __pyx_k_PickleError[] = "PickleError";
2464 static const char __pyx_k_cBASMFactor[] = "_cBASMFactor";
2465 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2466 static const char __pyx_k_asm_NR_solve[] = "asm_NR_solve";
2467 static const char __pyx_k_cASMFactor_2[] = "cASMFactor";
2468 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2469 static const char __pyx_k_stringsource[] = "stringsource";
2470 static const char __pyx_k_basm_NR_solve[] = "basm_NR_solve";
2471 static const char __pyx_k_cBASMFactor_2[] = "cBASMFactor";
2472 static const char __pyx_k_cSparseMatrix[] = "_cSparseMatrix";
2473 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2474 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2475 static const char __pyx_k_asm_NR_prepare[] = "asm_NR_prepare";
2476 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2477 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2478 static const char __pyx_k_basm_NR_prepare[] = "basm_NR_prepare";
2479 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2480 static const char __pyx_k_jacobi_NR_solve[] = "jacobi_NR_solve";
2481 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2482 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2483 static const char __pyx_k_ASMFactor___init[] = "ASMFactor.__init__";
2484 static const char __pyx_k_BASMFactor___init[] = "BASMFactor.__init__";
2485 static const char __pyx_k_jacobi_NR_prepare[] = "jacobi_NR_prepare";
2486 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2487 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2488 static const char __pyx_k_nl_jacobi_NR_solve[] = "nl_jacobi_NR_solve";
2489 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2490 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2491 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2492 static const char __pyx_k_gauss_seidel_NR_solve[] = "gauss_seidel_NR_solve";
2493 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2494 static const char __pyx_k_gauss_seidel_NR_preare[] = "gauss_seidel_NR_preare";
2495 static const char __pyx_k_proteus_csmoothers_pyx[] = "proteus/csmoothers.pyx";
2496 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2497 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2498 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2499 static const char __pyx_k_nl_gauss_seidel_NR_solve[] = "nl_gauss_seidel_NR_solve";
2500 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2501 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2502 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
2503 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2504 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2505 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2506 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2507 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2508 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2509 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2510 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2511 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2512 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2513 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2514 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2515 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2516 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2517 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2518 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2519 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2520 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
2521 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2522 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2523 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2524 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2525 static PyObject *__pyx_n_s_A;
2526 static PyObject *__pyx_n_s_ASCII;
2527 static PyObject *__pyx_n_s_ASMFactor;
2528 static PyObject *__pyx_n_s_ASMFactor___init;
2529 static PyObject *__pyx_n_s_BASMFactor;
2530 static PyObject *__pyx_n_s_BASMFactor___init;
2531 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2532 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2533 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2534 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2535 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2536 static PyObject *__pyx_n_s_Ellipsis;
2537 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2538 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2539 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2540 static PyObject *__pyx_n_s_ImportError;
2541 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2542 static PyObject *__pyx_n_s_IndexError;
2543 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2544 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2545 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2546 static PyObject *__pyx_n_s_L;
2547 static PyObject *__pyx_n_s_M;
2548 static PyObject *__pyx_n_s_MemoryError;
2549 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2550 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2551 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2552 static PyObject *__pyx_n_b_O;
2553 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2554 static PyObject *__pyx_n_s_PickleError;
2555 static PyObject *__pyx_n_s_R;
2556 static PyObject *__pyx_n_s_RuntimeError;
2557 static PyObject *__pyx_n_s_TypeError;
2558 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2559 static PyObject *__pyx_n_s_ValueError;
2560 static PyObject *__pyx_n_s_View_MemoryView;
2561 static PyObject *__pyx_n_s_allocate_buffer;
2562 static PyObject *__pyx_n_s_asmFactor;
2563 static PyObject *__pyx_n_s_asm_NR_prepare;
2564 static PyObject *__pyx_n_s_asm_NR_solve;
2565 static PyObject *__pyx_n_s_base;
2566 static PyObject *__pyx_n_s_basmFactor;
2567 static PyObject *__pyx_n_s_basm_NR_prepare;
2568 static PyObject *__pyx_n_s_basm_NR_solve;
2569 static PyObject *__pyx_n_s_bs;
2570 static PyObject *__pyx_n_s_c;
2571 static PyObject *__pyx_n_u_c;
2572 static PyObject *__pyx_n_s_cASMFactor;
2573 static PyObject *__pyx_n_s_cASMFactor_2;
2574 static PyObject *__pyx_n_s_cBASMFactor;
2575 static PyObject *__pyx_n_s_cBASMFactor_2;
2576 static PyObject *__pyx_n_s_cSparseMatrix;
2577 static PyObject *__pyx_n_s_class;
2578 static PyObject *__pyx_n_s_cline_in_traceback;
2579 static PyObject *__pyx_kp_s_contiguous_and_direct;
2580 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2581 static PyObject *__pyx_n_s_csmoothers;
2582 static PyObject *__pyx_n_s_dX;
2583 static PyObject *__pyx_n_s_dict;
2584 static PyObject *__pyx_n_s_doc;
2585 static PyObject *__pyx_n_s_dtype_is_object;
2586 static PyObject *__pyx_n_s_encode;
2587 static PyObject *__pyx_n_s_enumerate;
2588 static PyObject *__pyx_n_s_error;
2589 static PyObject *__pyx_n_s_flags;
2590 static PyObject *__pyx_n_s_format;
2591 static PyObject *__pyx_n_s_fortran;
2592 static PyObject *__pyx_n_u_fortran;
2593 static PyObject *__pyx_n_s_gauss_seidel_NR_preare;
2594 static PyObject *__pyx_n_s_gauss_seidel_NR_solve;
2595 static PyObject *__pyx_n_s_getstate;
2596 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2597 static PyObject *__pyx_n_s_id;
2598 static PyObject *__pyx_n_s_import;
2599 static PyObject *__pyx_n_s_init;
2600 static PyObject *__pyx_n_s_itemsize;
2601 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2602 static PyObject *__pyx_n_s_jacobi_NR_prepare;
2603 static PyObject *__pyx_n_s_jacobi_NR_solve;
2604 static PyObject *__pyx_n_s_main;
2605 static PyObject *__pyx_n_s_memview;
2606 static PyObject *__pyx_n_s_metaclass;
2607 static PyObject *__pyx_n_s_mode;
2608 static PyObject *__pyx_n_s_module;
2609 static PyObject *__pyx_n_s_name;
2610 static PyObject *__pyx_n_s_name_2;
2611 static PyObject *__pyx_n_s_nc;
2612 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2613 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2614 static PyObject *__pyx_n_s_ndim;
2615 static PyObject *__pyx_n_s_new;
2616 static PyObject *__pyx_n_s_nl_gauss_seidel_NR_solve;
2617 static PyObject *__pyx_n_s_nl_jacobi_NR_solve;
2618 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2619 static PyObject *__pyx_n_s_node_order;
2620 static PyObject *__pyx_n_s_np;
2621 static PyObject *__pyx_n_s_nr;
2622 static PyObject *__pyx_n_s_numpy;
2623 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2624 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2625 static PyObject *__pyx_n_s_obj;
2626 static PyObject *__pyx_n_s_object;
2627 static PyObject *__pyx_n_s_pack;
2628 static PyObject *__pyx_n_s_pickle;
2629 static PyObject *__pyx_n_s_prepare;
2630 static PyObject *__pyx_kp_s_proteus_csmoothers_pyx;
2631 static PyObject *__pyx_n_s_pyx_PickleError;
2632 static PyObject *__pyx_n_s_pyx_checksum;
2633 static PyObject *__pyx_n_s_pyx_getbuffer;
2634 static PyObject *__pyx_n_s_pyx_result;
2635 static PyObject *__pyx_n_s_pyx_state;
2636 static PyObject *__pyx_n_s_pyx_type;
2637 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2638 static PyObject *__pyx_n_s_pyx_vtable;
2639 static PyObject *__pyx_n_s_qualname;
2640 static PyObject *__pyx_n_s_range;
2641 static PyObject *__pyx_n_s_reduce;
2642 static PyObject *__pyx_n_s_reduce_cython;
2643 static PyObject *__pyx_n_s_reduce_ex;
2644 static PyObject *__pyx_n_s_self;
2645 static PyObject *__pyx_n_s_setstate;
2646 static PyObject *__pyx_n_s_setstate_cython;
2647 static PyObject *__pyx_n_s_shape;
2648 static PyObject *__pyx_n_s_size;
2649 static PyObject *__pyx_n_s_start;
2650 static PyObject *__pyx_n_s_step;
2651 static PyObject *__pyx_n_s_stop;
2652 static PyObject *__pyx_kp_s_strided_and_direct;
2653 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2654 static PyObject *__pyx_kp_s_strided_and_indirect;
2655 static PyObject *__pyx_kp_s_stringsource;
2656 static PyObject *__pyx_n_s_struct;
2657 static PyObject *__pyx_n_s_test;
2658 static PyObject *__pyx_n_s_tol;
2659 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2660 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2661 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2662 static PyObject *__pyx_n_s_unpack;
2663 static PyObject *__pyx_n_s_update;
2664 static PyObject *__pyx_n_s_w;
2665 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L); /* proto */
2666 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L); /* proto */
2667 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self); /* proto */
2668 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self); /* proto */
2669 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2670 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs); /* proto */
2671 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L, int __pyx_v_bs); /* proto */
2672 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self); /* proto */
2673 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self); /* proto */
2674 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2675 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M); /* proto */
2676 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX); /* proto */
2677 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX); /* proto */
2678 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M); /* proto */
2679 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX); /* proto */
2680 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX); /* proto */
2681 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor); /* proto */
2682 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX); /* proto */
2683 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor); /* proto */
2684 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX); /* proto */
2685 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2686 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
2687 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2688 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2689 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2690 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2691 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2692 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2693 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2694 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2695 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2696 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2697 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2698 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2699 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2700 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2701 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2702 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2703 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2704 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2705 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2706 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2707 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2708 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2709 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2710 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2711 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2712 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2713 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2714 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2715 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2716 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2717 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2718 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2719 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2720 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2721 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2722 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2723 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2724 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2725 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2726 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2727 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2728 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2729 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2730 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2731 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2732 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2733 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2734 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2735 static PyObject *__pyx_int_0;
2736 static PyObject *__pyx_int_1;
2737 static PyObject *__pyx_int_184977713;
2738 static PyObject *__pyx_int_neg_1;
2739 static PyObject *__pyx_tuple_;
2740 static PyObject *__pyx_tuple__2;
2741 static PyObject *__pyx_tuple__3;
2742 static PyObject *__pyx_tuple__4;
2743 static PyObject *__pyx_tuple__5;
2744 static PyObject *__pyx_tuple__6;
2745 static PyObject *__pyx_tuple__7;
2746 static PyObject *__pyx_tuple__8;
2747 static PyObject *__pyx_tuple__9;
2748 static PyObject *__pyx_slice__26;
2749 static PyObject *__pyx_tuple__10;
2750 static PyObject *__pyx_tuple__11;
2751 static PyObject *__pyx_tuple__12;
2752 static PyObject *__pyx_tuple__13;
2753 static PyObject *__pyx_tuple__14;
2754 static PyObject *__pyx_tuple__15;
2755 static PyObject *__pyx_tuple__16;
2756 static PyObject *__pyx_tuple__17;
2757 static PyObject *__pyx_tuple__18;
2758 static PyObject *__pyx_tuple__19;
2759 static PyObject *__pyx_tuple__20;
2760 static PyObject *__pyx_tuple__21;
2761 static PyObject *__pyx_tuple__22;
2762 static PyObject *__pyx_tuple__23;
2763 static PyObject *__pyx_tuple__24;
2764 static PyObject *__pyx_tuple__25;
2765 static PyObject *__pyx_tuple__27;
2766 static PyObject *__pyx_tuple__28;
2767 static PyObject *__pyx_tuple__29;
2768 static PyObject *__pyx_tuple__30;
2769 static PyObject *__pyx_tuple__31;
2770 static PyObject *__pyx_tuple__33;
2771 static PyObject *__pyx_tuple__34;
2772 static PyObject *__pyx_tuple__36;
2773 static PyObject *__pyx_tuple__38;
2774 static PyObject *__pyx_tuple__40;
2775 static PyObject *__pyx_tuple__42;
2776 static PyObject *__pyx_tuple__44;
2777 static PyObject *__pyx_tuple__46;
2778 static PyObject *__pyx_tuple__48;
2779 static PyObject *__pyx_tuple__50;
2780 static PyObject *__pyx_tuple__52;
2781 static PyObject *__pyx_tuple__54;
2782 static PyObject *__pyx_tuple__56;
2783 static PyObject *__pyx_tuple__57;
2784 static PyObject *__pyx_tuple__58;
2785 static PyObject *__pyx_tuple__59;
2786 static PyObject *__pyx_tuple__60;
2787 static PyObject *__pyx_tuple__61;
2788 static PyObject *__pyx_codeobj__32;
2789 static PyObject *__pyx_codeobj__35;
2790 static PyObject *__pyx_codeobj__37;
2791 static PyObject *__pyx_codeobj__39;
2792 static PyObject *__pyx_codeobj__41;
2793 static PyObject *__pyx_codeobj__43;
2794 static PyObject *__pyx_codeobj__45;
2795 static PyObject *__pyx_codeobj__47;
2796 static PyObject *__pyx_codeobj__49;
2797 static PyObject *__pyx_codeobj__51;
2798 static PyObject *__pyx_codeobj__53;
2799 static PyObject *__pyx_codeobj__55;
2800 static PyObject *__pyx_codeobj__62;
2801 /* Late includes */
2802 
2803 /* "csmoothers.pyx":7
2804  * class ASMFactor(object):
2805  *
2806  * def __init__(self, L): # <<<<<<<<<<<<<<
2807  * self.L = L
2808  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2809  */
2810 
2811 /* Python wrapper */
2812 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2813 static PyMethodDef __pyx_mdef_10csmoothers_9ASMFactor_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9ASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2814 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2815  PyObject *__pyx_v_self = 0;
2816  PyObject *__pyx_v_L = 0;
2817  PyObject *__pyx_r = 0;
2818  __Pyx_RefNannyDeclarations
2819  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2820  {
2821  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,0};
2822  PyObject* values[2] = {0,0};
2823  if (unlikely(__pyx_kwds)) {
2824  Py_ssize_t kw_args;
2825  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2826  switch (pos_args) {
2827  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2828  CYTHON_FALLTHROUGH;
2829  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2830  CYTHON_FALLTHROUGH;
2831  case 0: break;
2832  default: goto __pyx_L5_argtuple_error;
2833  }
2834  kw_args = PyDict_Size(__pyx_kwds);
2835  switch (pos_args) {
2836  case 0:
2837  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2838  else goto __pyx_L5_argtuple_error;
2839  CYTHON_FALLTHROUGH;
2840  case 1:
2841  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2842  else {
2843  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 7, __pyx_L3_error)
2844  }
2845  }
2846  if (unlikely(kw_args > 0)) {
2847  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 7, __pyx_L3_error)
2848  }
2849  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2850  goto __pyx_L5_argtuple_error;
2851  } else {
2852  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2853  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2854  }
2855  __pyx_v_self = values[0];
2856  __pyx_v_L = values[1];
2857  }
2858  goto __pyx_L4_argument_unpacking_done;
2859  __pyx_L5_argtuple_error:;
2860  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7, __pyx_L3_error)
2861  __pyx_L3_error:;
2862  __Pyx_AddTraceback("csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2863  __Pyx_RefNannyFinishContext();
2864  return NULL;
2865  __pyx_L4_argument_unpacking_done:;
2866  __pyx_r = __pyx_pf_10csmoothers_9ASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L);
2867 
2868  /* function exit code */
2869  __Pyx_RefNannyFinishContext();
2870  return __pyx_r;
2871 }
2872 
2873 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L) {
2874  PyObject *__pyx_r = NULL;
2875  __Pyx_RefNannyDeclarations
2876  PyObject *__pyx_t_1 = NULL;
2877  PyObject *__pyx_t_2 = NULL;
2878  __Pyx_RefNannySetupContext("__init__", 0);
2879 
2880  /* "csmoothers.pyx":8
2881  *
2882  * def __init__(self, L):
2883  * self.L = L # <<<<<<<<<<<<<<
2884  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2885  *
2886  */
2887  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
2888 
2889  /* "csmoothers.pyx":9
2890  * def __init__(self, L):
2891  * self.L = L
2892  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix) # <<<<<<<<<<<<<<
2893  *
2894  * cdef class cASMFactor(object):
2895  */
2896  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
2897  __Pyx_GOTREF(__pyx_t_1);
2898  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
2899  __Pyx_GOTREF(__pyx_t_2);
2900  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2901  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_10csmoothers_cASMFactor), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
2902  __Pyx_GOTREF(__pyx_t_1);
2903  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2904  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
2905  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2906 
2907  /* "csmoothers.pyx":7
2908  * class ASMFactor(object):
2909  *
2910  * def __init__(self, L): # <<<<<<<<<<<<<<
2911  * self.L = L
2912  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2913  */
2914 
2915  /* function exit code */
2916  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2917  goto __pyx_L0;
2918  __pyx_L1_error:;
2919  __Pyx_XDECREF(__pyx_t_1);
2920  __Pyx_XDECREF(__pyx_t_2);
2921  __Pyx_AddTraceback("csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2922  __pyx_r = NULL;
2923  __pyx_L0:;
2924  __Pyx_XGIVEREF(__pyx_r);
2925  __Pyx_RefNannyFinishContext();
2926  return __pyx_r;
2927 }
2928 
2929 /* "csmoothers.pyx":13
2930  * cdef class cASMFactor(object):
2931  *
2932  * def __cinit__(self, # <<<<<<<<<<<<<<
2933  * superluWrappers.cSparseMatrix L):
2934  * cdef int rval = 0
2935  */
2936 
2937 /* Python wrapper */
2938 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2939 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2940  struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
2941  int __pyx_r;
2942  __Pyx_RefNannyDeclarations
2943  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
2944  {
2945  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,0};
2946  PyObject* values[1] = {0};
2947  if (unlikely(__pyx_kwds)) {
2948  Py_ssize_t kw_args;
2949  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2950  switch (pos_args) {
2951  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2952  CYTHON_FALLTHROUGH;
2953  case 0: break;
2954  default: goto __pyx_L5_argtuple_error;
2955  }
2956  kw_args = PyDict_Size(__pyx_kwds);
2957  switch (pos_args) {
2958  case 0:
2959  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2960  else goto __pyx_L5_argtuple_error;
2961  }
2962  if (unlikely(kw_args > 0)) {
2963  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
2964  }
2965  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2966  goto __pyx_L5_argtuple_error;
2967  } else {
2968  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2969  }
2970  __pyx_v_L = ((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
2971  }
2972  goto __pyx_L4_argument_unpacking_done;
2973  __pyx_L5_argtuple_error:;
2974  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
2975  __pyx_L3_error:;
2976  __Pyx_AddTraceback("csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2977  __Pyx_RefNannyFinishContext();
2978  return -1;
2979  __pyx_L4_argument_unpacking_done:;
2980  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1, "L", 0))) __PYX_ERR(0, 14, __pyx_L1_error)
2981  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor___cinit__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), __pyx_v_L);
2982 
2983  /* function exit code */
2984  goto __pyx_L0;
2985  __pyx_L1_error:;
2986  __pyx_r = -1;
2987  __pyx_L0:;
2988  __Pyx_RefNannyFinishContext();
2989  return __pyx_r;
2990 }
2991 
2992 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L) {
2993  int __pyx_v_rval;
2994  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
2995  int __pyx_r;
2996  __Pyx_RefNannyDeclarations
2997  PyObject *__pyx_t_1 = NULL;
2998  int __pyx_t_2;
2999  __Pyx_RefNannySetupContext("__cinit__", 0);
3000 
3001  /* "csmoothers.pyx":15
3002  * def __cinit__(self,
3003  * superluWrappers.cSparseMatrix L):
3004  * cdef int rval = 0 # <<<<<<<<<<<<<<
3005  * cdef SuperMatrix AS
3006  * AS.Stype = superluWrappers._SLU_NR
3007  */
3008  __pyx_v_rval = 0;
3009 
3010  /* "csmoothers.pyx":17
3011  * cdef int rval = 0
3012  * cdef SuperMatrix AS
3013  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
3014  * AS.Dtype = superluWrappers._SLU_D
3015  * AS.Mtype = superluWrappers._SLU_GE
3016  */
3017  __pyx_v_AS.Stype = SLU_NR;
3018 
3019  /* "csmoothers.pyx":18
3020  * cdef SuperMatrix AS
3021  * AS.Stype = superluWrappers._SLU_NR
3022  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
3023  * AS.Mtype = superluWrappers._SLU_GE
3024  * AS.nrow = L.nr
3025  */
3026  __pyx_v_AS.Dtype = SLU_D;
3027 
3028  /* "csmoothers.pyx":19
3029  * AS.Stype = superluWrappers._SLU_NR
3030  * AS.Dtype = superluWrappers._SLU_D
3031  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
3032  * AS.nrow = L.nr
3033  * AS.ncol = L.nc
3034  */
3035  __pyx_v_AS.Mtype = SLU_GE;
3036 
3037  /* "csmoothers.pyx":20
3038  * AS.Dtype = superluWrappers._SLU_D
3039  * AS.Mtype = superluWrappers._SLU_GE
3040  * AS.nrow = L.nr # <<<<<<<<<<<<<<
3041  * AS.ncol = L.nc
3042  * AS.Store = &L.A
3043  */
3044  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
3045  __Pyx_GOTREF(__pyx_t_1);
3046  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L1_error)
3047  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3048  __pyx_v_AS.nrow = __pyx_t_2;
3049 
3050  /* "csmoothers.pyx":21
3051  * AS.Mtype = superluWrappers._SLU_GE
3052  * AS.nrow = L.nr
3053  * AS.ncol = L.nc # <<<<<<<<<<<<<<
3054  * AS.Store = &L.A
3055  * rval = casm_NR_init(&AS,
3056  */
3057  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
3058  __Pyx_GOTREF(__pyx_t_1);
3059  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error)
3060  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3061  __pyx_v_AS.ncol = __pyx_t_2;
3062 
3063  /* "csmoothers.pyx":22
3064  * AS.nrow = L.nr
3065  * AS.ncol = L.nc
3066  * AS.Store = &L.A # <<<<<<<<<<<<<<
3067  * rval = casm_NR_init(&AS,
3068  * &self.subdomain_dim,
3069  */
3070  __pyx_v_AS.Store = (&__pyx_v_L->A);
3071 
3072  /* "csmoothers.pyx":23
3073  * AS.ncol = L.nc
3074  * AS.Store = &L.A
3075  * rval = casm_NR_init(&AS, # <<<<<<<<<<<<<<
3076  * &self.subdomain_dim,
3077  * &self.l2g_L,
3078  */
3079  __pyx_v_rval = asm_NR_init((&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots));
3080 
3081  /* "csmoothers.pyx":30
3082  * &self.subdomain_dX,
3083  * &self.subdomain_pivots)
3084  * assert rval == 0 # <<<<<<<<<<<<<<
3085  *
3086  * def __dealloc__(self):
3087  */
3088  #ifndef CYTHON_WITHOUT_ASSERTIONS
3089  if (unlikely(!Py_OptimizeFlag)) {
3090  if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3091  PyErr_SetNone(PyExc_AssertionError);
3092  __PYX_ERR(0, 30, __pyx_L1_error)
3093  }
3094  }
3095  #endif
3096 
3097  /* "csmoothers.pyx":13
3098  * cdef class cASMFactor(object):
3099  *
3100  * def __cinit__(self, # <<<<<<<<<<<<<<
3101  * superluWrappers.cSparseMatrix L):
3102  * cdef int rval = 0
3103  */
3104 
3105  /* function exit code */
3106  __pyx_r = 0;
3107  goto __pyx_L0;
3108  __pyx_L1_error:;
3109  __Pyx_XDECREF(__pyx_t_1);
3110  __Pyx_AddTraceback("csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3111  __pyx_r = -1;
3112  __pyx_L0:;
3113  __Pyx_RefNannyFinishContext();
3114  return __pyx_r;
3115 }
3116 
3117 /* "csmoothers.pyx":32
3118  * assert rval == 0
3119  *
3120  * def __dealloc__(self): # <<<<<<<<<<<<<<
3121  * casm_NR_free(self.N,
3122  * self.subdomain_dim,
3123  */
3124 
3125 /* Python wrapper */
3126 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
3127 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3128  __Pyx_RefNannyDeclarations
3129  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
3130  __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3131 
3132  /* function exit code */
3133  __Pyx_RefNannyFinishContext();
3134 }
3135 
3136 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3137  __Pyx_RefNannyDeclarations
3138  __Pyx_RefNannySetupContext("__dealloc__", 0);
3139 
3140  /* "csmoothers.pyx":33
3141  *
3142  * def __dealloc__(self):
3143  * casm_NR_free(self.N, # <<<<<<<<<<<<<<
3144  * self.subdomain_dim,
3145  * self.l2g_L,
3146  */
3147  asm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots);
3148 
3149  /* "csmoothers.pyx":32
3150  * assert rval == 0
3151  *
3152  * def __dealloc__(self): # <<<<<<<<<<<<<<
3153  * casm_NR_free(self.N,
3154  * self.subdomain_dim,
3155  */
3156 
3157  /* function exit code */
3158  __Pyx_RefNannyFinishContext();
3159 }
3160 
3161 /* "(tree fragment)":1
3162  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3163  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3164  * def __setstate_cython__(self, __pyx_state):
3165  */
3166 
3167 /* Python wrapper */
3168 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3169 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3170  PyObject *__pyx_r = 0;
3171  __Pyx_RefNannyDeclarations
3172  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3173  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3174 
3175  /* function exit code */
3176  __Pyx_RefNannyFinishContext();
3177  return __pyx_r;
3178 }
3179 
3180 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3181  PyObject *__pyx_r = NULL;
3182  __Pyx_RefNannyDeclarations
3183  PyObject *__pyx_t_1 = NULL;
3184  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3185 
3186  /* "(tree fragment)":2
3187  * def __reduce_cython__(self):
3188  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3189  * def __setstate_cython__(self, __pyx_state):
3190  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3191  */
3192  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3193  __Pyx_GOTREF(__pyx_t_1);
3194  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3195  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3196  __PYX_ERR(1, 2, __pyx_L1_error)
3197 
3198  /* "(tree fragment)":1
3199  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3200  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3201  * def __setstate_cython__(self, __pyx_state):
3202  */
3203 
3204  /* function exit code */
3205  __pyx_L1_error:;
3206  __Pyx_XDECREF(__pyx_t_1);
3207  __Pyx_AddTraceback("csmoothers.cASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3208  __pyx_r = NULL;
3209  __Pyx_XGIVEREF(__pyx_r);
3210  __Pyx_RefNannyFinishContext();
3211  return __pyx_r;
3212 }
3213 
3214 /* "(tree fragment)":3
3215  * def __reduce_cython__(self):
3216  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3217  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3218  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3219  */
3220 
3221 /* Python wrapper */
3222 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3223 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3224  PyObject *__pyx_r = 0;
3225  __Pyx_RefNannyDeclarations
3226  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3227  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3228 
3229  /* function exit code */
3230  __Pyx_RefNannyFinishContext();
3231  return __pyx_r;
3232 }
3233 
3234 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3235  PyObject *__pyx_r = NULL;
3236  __Pyx_RefNannyDeclarations
3237  PyObject *__pyx_t_1 = NULL;
3238  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3239 
3240  /* "(tree fragment)":4
3241  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3242  * def __setstate_cython__(self, __pyx_state):
3243  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3244  */
3245  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3246  __Pyx_GOTREF(__pyx_t_1);
3247  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3248  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3249  __PYX_ERR(1, 4, __pyx_L1_error)
3250 
3251  /* "(tree fragment)":3
3252  * def __reduce_cython__(self):
3253  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3254  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3255  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3256  */
3257 
3258  /* function exit code */
3259  __pyx_L1_error:;
3260  __Pyx_XDECREF(__pyx_t_1);
3261  __Pyx_AddTraceback("csmoothers.cASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3262  __pyx_r = NULL;
3263  __Pyx_XGIVEREF(__pyx_r);
3264  __Pyx_RefNannyFinishContext();
3265  return __pyx_r;
3266 }
3267 
3268 /* "csmoothers.pyx":44
3269  * class BASMFactor(object):
3270  *
3271  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
3272  * self.L = L
3273  * self.bs = bs
3274  */
3275 
3276 /* Python wrapper */
3277 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3278 static PyMethodDef __pyx_mdef_10csmoothers_10BASMFactor_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_10BASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
3279 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3280  PyObject *__pyx_v_self = 0;
3281  PyObject *__pyx_v_L = 0;
3282  PyObject *__pyx_v_bs = 0;
3283  PyObject *__pyx_r = 0;
3284  __Pyx_RefNannyDeclarations
3285  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3286  {
3287  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,&__pyx_n_s_bs,0};
3288  PyObject* values[3] = {0,0,0};
3289  if (unlikely(__pyx_kwds)) {
3290  Py_ssize_t kw_args;
3291  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3292  switch (pos_args) {
3293  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3294  CYTHON_FALLTHROUGH;
3295  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3296  CYTHON_FALLTHROUGH;
3297  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3298  CYTHON_FALLTHROUGH;
3299  case 0: break;
3300  default: goto __pyx_L5_argtuple_error;
3301  }
3302  kw_args = PyDict_Size(__pyx_kwds);
3303  switch (pos_args) {
3304  case 0:
3305  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3306  else goto __pyx_L5_argtuple_error;
3307  CYTHON_FALLTHROUGH;
3308  case 1:
3309  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3310  else {
3311  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 44, __pyx_L3_error)
3312  }
3313  CYTHON_FALLTHROUGH;
3314  case 2:
3315  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3316  else {
3317  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 44, __pyx_L3_error)
3318  }
3319  }
3320  if (unlikely(kw_args > 0)) {
3321  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 44, __pyx_L3_error)
3322  }
3323  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3324  goto __pyx_L5_argtuple_error;
3325  } else {
3326  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3327  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3328  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3329  }
3330  __pyx_v_self = values[0];
3331  __pyx_v_L = values[1];
3332  __pyx_v_bs = values[2];
3333  }
3334  goto __pyx_L4_argument_unpacking_done;
3335  __pyx_L5_argtuple_error:;
3336  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 44, __pyx_L3_error)
3337  __pyx_L3_error:;
3338  __Pyx_AddTraceback("csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3339  __Pyx_RefNannyFinishContext();
3340  return NULL;
3341  __pyx_L4_argument_unpacking_done:;
3342  __pyx_r = __pyx_pf_10csmoothers_10BASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L, __pyx_v_bs);
3343 
3344  /* function exit code */
3345  __Pyx_RefNannyFinishContext();
3346  return __pyx_r;
3347 }
3348 
3349 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs) {
3350  PyObject *__pyx_r = NULL;
3351  __Pyx_RefNannyDeclarations
3352  PyObject *__pyx_t_1 = NULL;
3353  PyObject *__pyx_t_2 = NULL;
3354  PyObject *__pyx_t_3 = NULL;
3355  __Pyx_RefNannySetupContext("__init__", 0);
3356 
3357  /* "csmoothers.pyx":45
3358  *
3359  * def __init__(self, L, bs):
3360  * self.L = L # <<<<<<<<<<<<<<
3361  * self.bs = bs
3362  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3363  */
3364  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
3365 
3366  /* "csmoothers.pyx":46
3367  * def __init__(self, L, bs):
3368  * self.L = L
3369  * self.bs = bs # <<<<<<<<<<<<<<
3370  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3371  * self.bs)
3372  */
3373  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bs, __pyx_v_bs) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
3374 
3375  /* "csmoothers.pyx":47
3376  * self.L = L
3377  * self.bs = bs
3378  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix, # <<<<<<<<<<<<<<
3379  * self.bs)
3380  *
3381  */
3382  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3383  __Pyx_GOTREF(__pyx_t_1);
3384  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
3385  __Pyx_GOTREF(__pyx_t_2);
3386  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3387 
3388  /* "csmoothers.pyx":48
3389  * self.bs = bs
3390  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3391  * self.bs) # <<<<<<<<<<<<<<
3392  *
3393  * cdef class cBASMFactor(object):
3394  */
3395  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
3396  __Pyx_GOTREF(__pyx_t_1);
3397 
3398  /* "csmoothers.pyx":47
3399  * self.L = L
3400  * self.bs = bs
3401  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix, # <<<<<<<<<<<<<<
3402  * self.bs)
3403  *
3404  */
3405  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
3406  __Pyx_GOTREF(__pyx_t_3);
3407  __Pyx_GIVEREF(__pyx_t_2);
3408  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3409  __Pyx_GIVEREF(__pyx_t_1);
3410  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
3411  __pyx_t_2 = 0;
3412  __pyx_t_1 = 0;
3413  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10csmoothers_cBASMFactor), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3414  __Pyx_GOTREF(__pyx_t_1);
3415  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3416  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cBASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
3417  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3418 
3419  /* "csmoothers.pyx":44
3420  * class BASMFactor(object):
3421  *
3422  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
3423  * self.L = L
3424  * self.bs = bs
3425  */
3426 
3427  /* function exit code */
3428  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3429  goto __pyx_L0;
3430  __pyx_L1_error:;
3431  __Pyx_XDECREF(__pyx_t_1);
3432  __Pyx_XDECREF(__pyx_t_2);
3433  __Pyx_XDECREF(__pyx_t_3);
3434  __Pyx_AddTraceback("csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3435  __pyx_r = NULL;
3436  __pyx_L0:;
3437  __Pyx_XGIVEREF(__pyx_r);
3438  __Pyx_RefNannyFinishContext();
3439  return __pyx_r;
3440 }
3441 
3442 /* "csmoothers.pyx":52
3443  * cdef class cBASMFactor(object):
3444  *
3445  * def __cinit__(self, # <<<<<<<<<<<<<<
3446  * superluWrappers.cSparseMatrix L,
3447  * int bs):
3448  */
3449 
3450 /* Python wrapper */
3451 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3452 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3453  struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
3454  int __pyx_v_bs;
3455  int __pyx_r;
3456  __Pyx_RefNannyDeclarations
3457  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
3458  {
3459  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,&__pyx_n_s_bs,0};
3460  PyObject* values[2] = {0,0};
3461  if (unlikely(__pyx_kwds)) {
3462  Py_ssize_t kw_args;
3463  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3464  switch (pos_args) {
3465  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3466  CYTHON_FALLTHROUGH;
3467  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3468  CYTHON_FALLTHROUGH;
3469  case 0: break;
3470  default: goto __pyx_L5_argtuple_error;
3471  }
3472  kw_args = PyDict_Size(__pyx_kwds);
3473  switch (pos_args) {
3474  case 0:
3475  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3476  else goto __pyx_L5_argtuple_error;
3477  CYTHON_FALLTHROUGH;
3478  case 1:
3479  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3480  else {
3481  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 52, __pyx_L3_error)
3482  }
3483  }
3484  if (unlikely(kw_args > 0)) {
3485  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3486  }
3487  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3488  goto __pyx_L5_argtuple_error;
3489  } else {
3490  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3491  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3492  }
3493  __pyx_v_L = ((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
3494  __pyx_v_bs = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_bs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error)
3495  }
3496  goto __pyx_L4_argument_unpacking_done;
3497  __pyx_L5_argtuple_error:;
3498  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3499  __pyx_L3_error:;
3500  __Pyx_AddTraceback("csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3501  __Pyx_RefNannyFinishContext();
3502  return -1;
3503  __pyx_L4_argument_unpacking_done:;
3504  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1, "L", 0))) __PYX_ERR(0, 53, __pyx_L1_error)
3505  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor___cinit__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), __pyx_v_L, __pyx_v_bs);
3506 
3507  /* function exit code */
3508  goto __pyx_L0;
3509  __pyx_L1_error:;
3510  __pyx_r = -1;
3511  __pyx_L0:;
3512  __Pyx_RefNannyFinishContext();
3513  return __pyx_r;
3514 }
3515 
3516 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L, int __pyx_v_bs) {
3517  int __pyx_v_rval;
3518  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3519  int __pyx_r;
3520  __Pyx_RefNannyDeclarations
3521  PyObject *__pyx_t_1 = NULL;
3522  int __pyx_t_2;
3523  __Pyx_RefNannySetupContext("__cinit__", 0);
3524 
3525  /* "csmoothers.pyx":55
3526  * superluWrappers.cSparseMatrix L,
3527  * int bs):
3528  * cdef int rval = 0 # <<<<<<<<<<<<<<
3529  * cdef SuperMatrix AS
3530  * AS.Stype = superluWrappers._SLU_NR
3531  */
3532  __pyx_v_rval = 0;
3533 
3534  /* "csmoothers.pyx":57
3535  * cdef int rval = 0
3536  * cdef SuperMatrix AS
3537  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
3538  * AS.Dtype = superluWrappers._SLU_D
3539  * AS.Mtype = superluWrappers._SLU_GE
3540  */
3541  __pyx_v_AS.Stype = SLU_NR;
3542 
3543  /* "csmoothers.pyx":58
3544  * cdef SuperMatrix AS
3545  * AS.Stype = superluWrappers._SLU_NR
3546  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
3547  * AS.Mtype = superluWrappers._SLU_GE
3548  * AS.nrow = L.nr
3549  */
3550  __pyx_v_AS.Dtype = SLU_D;
3551 
3552  /* "csmoothers.pyx":59
3553  * AS.Stype = superluWrappers._SLU_NR
3554  * AS.Dtype = superluWrappers._SLU_D
3555  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
3556  * AS.nrow = L.nr
3557  * AS.ncol = L.nc
3558  */
3559  __pyx_v_AS.Mtype = SLU_GE;
3560 
3561  /* "csmoothers.pyx":60
3562  * AS.Dtype = superluWrappers._SLU_D
3563  * AS.Mtype = superluWrappers._SLU_GE
3564  * AS.nrow = L.nr # <<<<<<<<<<<<<<
3565  * AS.ncol = L.nc
3566  * AS.Store = &L.A
3567  */
3568  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3569  __Pyx_GOTREF(__pyx_t_1);
3570  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
3571  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3572  __pyx_v_AS.nrow = __pyx_t_2;
3573 
3574  /* "csmoothers.pyx":61
3575  * AS.Mtype = superluWrappers._SLU_GE
3576  * AS.nrow = L.nr
3577  * AS.ncol = L.nc # <<<<<<<<<<<<<<
3578  * AS.Store = &L.A
3579  * rval = cbasm_NR_init(bs,
3580  */
3581  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
3582  __Pyx_GOTREF(__pyx_t_1);
3583  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
3584  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3585  __pyx_v_AS.ncol = __pyx_t_2;
3586 
3587  /* "csmoothers.pyx":62
3588  * AS.nrow = L.nr
3589  * AS.ncol = L.nc
3590  * AS.Store = &L.A # <<<<<<<<<<<<<<
3591  * rval = cbasm_NR_init(bs,
3592  * &AS,
3593  */
3594  __pyx_v_AS.Store = (&__pyx_v_L->A);
3595 
3596  /* "csmoothers.pyx":63
3597  * AS.ncol = L.nc
3598  * AS.Store = &L.A
3599  * rval = cbasm_NR_init(bs, # <<<<<<<<<<<<<<
3600  * &AS,
3601  * &self.subdomain_dim,
3602  */
3603  __pyx_v_rval = basm_NR_init(__pyx_v_bs, (&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots), (&__pyx_v_self->subdomain_col_pivots));
3604 
3605  /* "csmoothers.pyx":72
3606  * &self.subdomain_pivots,
3607  * &self.subdomain_col_pivots)
3608  * assert rval == 0 # <<<<<<<<<<<<<<
3609  *
3610  * def __dealloc__(self):
3611  */
3612  #ifndef CYTHON_WITHOUT_ASSERTIONS
3613  if (unlikely(!Py_OptimizeFlag)) {
3614  if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3615  PyErr_SetNone(PyExc_AssertionError);
3616  __PYX_ERR(0, 72, __pyx_L1_error)
3617  }
3618  }
3619  #endif
3620 
3621  /* "csmoothers.pyx":52
3622  * cdef class cBASMFactor(object):
3623  *
3624  * def __cinit__(self, # <<<<<<<<<<<<<<
3625  * superluWrappers.cSparseMatrix L,
3626  * int bs):
3627  */
3628 
3629  /* function exit code */
3630  __pyx_r = 0;
3631  goto __pyx_L0;
3632  __pyx_L1_error:;
3633  __Pyx_XDECREF(__pyx_t_1);
3634  __Pyx_AddTraceback("csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3635  __pyx_r = -1;
3636  __pyx_L0:;
3637  __Pyx_RefNannyFinishContext();
3638  return __pyx_r;
3639 }
3640 
3641 /* "csmoothers.pyx":74
3642  * assert rval == 0
3643  *
3644  * def __dealloc__(self): # <<<<<<<<<<<<<<
3645  * cbasm_NR_free(self.N,
3646  * self.subdomain_dim,
3647  */
3648 
3649 /* Python wrapper */
3650 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
3651 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3652  __Pyx_RefNannyDeclarations
3653  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
3654  __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3655 
3656  /* function exit code */
3657  __Pyx_RefNannyFinishContext();
3658 }
3659 
3660 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3661  __Pyx_RefNannyDeclarations
3662  __Pyx_RefNannySetupContext("__dealloc__", 0);
3663 
3664  /* "csmoothers.pyx":75
3665  *
3666  * def __dealloc__(self):
3667  * cbasm_NR_free(self.N, # <<<<<<<<<<<<<<
3668  * self.subdomain_dim,
3669  * self.l2g_L,
3670  */
3671  basm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots, __pyx_v_self->subdomain_col_pivots);
3672 
3673  /* "csmoothers.pyx":74
3674  * assert rval == 0
3675  *
3676  * def __dealloc__(self): # <<<<<<<<<<<<<<
3677  * cbasm_NR_free(self.N,
3678  * self.subdomain_dim,
3679  */
3680 
3681  /* function exit code */
3682  __Pyx_RefNannyFinishContext();
3683 }
3684 
3685 /* "(tree fragment)":1
3686  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3687  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3688  * def __setstate_cython__(self, __pyx_state):
3689  */
3690 
3691 /* Python wrapper */
3692 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3693 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3694  PyObject *__pyx_r = 0;
3695  __Pyx_RefNannyDeclarations
3696  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3697  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3698 
3699  /* function exit code */
3700  __Pyx_RefNannyFinishContext();
3701  return __pyx_r;
3702 }
3703 
3704 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3705  PyObject *__pyx_r = NULL;
3706  __Pyx_RefNannyDeclarations
3707  PyObject *__pyx_t_1 = NULL;
3708  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3709 
3710  /* "(tree fragment)":2
3711  * def __reduce_cython__(self):
3712  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3713  * def __setstate_cython__(self, __pyx_state):
3714  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3715  */
3716  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3717  __Pyx_GOTREF(__pyx_t_1);
3718  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3719  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3720  __PYX_ERR(1, 2, __pyx_L1_error)
3721 
3722  /* "(tree fragment)":1
3723  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3724  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3725  * def __setstate_cython__(self, __pyx_state):
3726  */
3727 
3728  /* function exit code */
3729  __pyx_L1_error:;
3730  __Pyx_XDECREF(__pyx_t_1);
3731  __Pyx_AddTraceback("csmoothers.cBASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3732  __pyx_r = NULL;
3733  __Pyx_XGIVEREF(__pyx_r);
3734  __Pyx_RefNannyFinishContext();
3735  return __pyx_r;
3736 }
3737 
3738 /* "(tree fragment)":3
3739  * def __reduce_cython__(self):
3740  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3741  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3742  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3743  */
3744 
3745 /* Python wrapper */
3746 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3747 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3748  PyObject *__pyx_r = 0;
3749  __Pyx_RefNannyDeclarations
3750  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3751  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3752 
3753  /* function exit code */
3754  __Pyx_RefNannyFinishContext();
3755  return __pyx_r;
3756 }
3757 
3758 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3759  PyObject *__pyx_r = NULL;
3760  __Pyx_RefNannyDeclarations
3761  PyObject *__pyx_t_1 = NULL;
3762  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3763 
3764  /* "(tree fragment)":4
3765  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3766  * def __setstate_cython__(self, __pyx_state):
3767  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3768  */
3769  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3770  __Pyx_GOTREF(__pyx_t_1);
3771  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3772  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3773  __PYX_ERR(1, 4, __pyx_L1_error)
3774 
3775  /* "(tree fragment)":3
3776  * def __reduce_cython__(self):
3777  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3778  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3779  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3780  */
3781 
3782  /* function exit code */
3783  __pyx_L1_error:;
3784  __Pyx_XDECREF(__pyx_t_1);
3785  __Pyx_AddTraceback("csmoothers.cBASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3786  __pyx_r = NULL;
3787  __Pyx_XGIVEREF(__pyx_r);
3788  __Pyx_RefNannyFinishContext();
3789  return __pyx_r;
3790 }
3791 
3792 /* "csmoothers.pyx":84
3793  * self.subdomain_col_pivots)
3794  *
3795  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
3796  * """
3797  *
3798  */
3799 
3800 /* Python wrapper */
3801 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3802 static char __pyx_doc_10csmoothers_jacobi_NR_prepare[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n w : double\n tol : double\n M : np.array\n ";
3803 static PyMethodDef __pyx_mdef_10csmoothers_1jacobi_NR_prepare = {"jacobi_NR_prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_1jacobi_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_jacobi_NR_prepare};
3804 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3805  PyObject *__pyx_v_A = 0;
3806  PyObject *__pyx_v_w = 0;
3807  PyObject *__pyx_v_tol = 0;
3808  PyObject *__pyx_v_M = 0;
3809  PyObject *__pyx_r = 0;
3810  __Pyx_RefNannyDeclarations
3811  __Pyx_RefNannySetupContext("jacobi_NR_prepare (wrapper)", 0);
3812  {
3813  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
3814  PyObject* values[4] = {0,0,0,0};
3815  if (unlikely(__pyx_kwds)) {
3816  Py_ssize_t kw_args;
3817  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3818  switch (pos_args) {
3819  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3820  CYTHON_FALLTHROUGH;
3821  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3822  CYTHON_FALLTHROUGH;
3823  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3824  CYTHON_FALLTHROUGH;
3825  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3826  CYTHON_FALLTHROUGH;
3827  case 0: break;
3828  default: goto __pyx_L5_argtuple_error;
3829  }
3830  kw_args = PyDict_Size(__pyx_kwds);
3831  switch (pos_args) {
3832  case 0:
3833  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3834  else goto __pyx_L5_argtuple_error;
3835  CYTHON_FALLTHROUGH;
3836  case 1:
3837  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
3838  else {
3839  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 1); __PYX_ERR(0, 84, __pyx_L3_error)
3840  }
3841  CYTHON_FALLTHROUGH;
3842  case 2:
3843  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
3844  else {
3845  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 2); __PYX_ERR(0, 84, __pyx_L3_error)
3846  }
3847  CYTHON_FALLTHROUGH;
3848  case 3:
3849  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
3850  else {
3851  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 3); __PYX_ERR(0, 84, __pyx_L3_error)
3852  }
3853  }
3854  if (unlikely(kw_args > 0)) {
3855  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "jacobi_NR_prepare") < 0)) __PYX_ERR(0, 84, __pyx_L3_error)
3856  }
3857  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3858  goto __pyx_L5_argtuple_error;
3859  } else {
3860  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3861  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3862  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3863  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3864  }
3865  __pyx_v_A = values[0];
3866  __pyx_v_w = values[1];
3867  __pyx_v_tol = values[2];
3868  __pyx_v_M = values[3];
3869  }
3870  goto __pyx_L4_argument_unpacking_done;
3871  __pyx_L5_argtuple_error:;
3872  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error)
3873  __pyx_L3_error:;
3874  __Pyx_AddTraceback("csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
3875  __Pyx_RefNannyFinishContext();
3876  return NULL;
3877  __pyx_L4_argument_unpacking_done:;
3878  __pyx_r = __pyx_pf_10csmoothers_jacobi_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
3879 
3880  /* function exit code */
3881  __Pyx_RefNannyFinishContext();
3882  return __pyx_r;
3883 }
3884 
3885 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
3886  PyObject *__pyx_r = NULL;
3887  __Pyx_RefNannyDeclarations
3888  PyObject *__pyx_t_1 = NULL;
3889  double __pyx_t_2;
3890  double __pyx_t_3;
3891  __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
3892  __Pyx_RefNannySetupContext("jacobi_NR_prepare", 0);
3893 
3894  /* "csmoothers.pyx":94
3895  * M : np.array
3896  * """
3897  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M) # <<<<<<<<<<<<<<
3898  *
3899  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm,
3900  */
3901  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
3902  __Pyx_GOTREF(__pyx_t_1);
3903  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 94, __pyx_L1_error)
3904  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
3905  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
3906  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 94, __pyx_L1_error)
3907  __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
3908  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3909  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3910  __pyx_t_4.memview = NULL;
3911  __pyx_t_4.data = NULL;
3912 
3913  /* "csmoothers.pyx":84
3914  * self.subdomain_col_pivots)
3915  *
3916  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
3917  * """
3918  *
3919  */
3920 
3921  /* function exit code */
3922  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3923  goto __pyx_L0;
3924  __pyx_L1_error:;
3925  __Pyx_XDECREF(__pyx_t_1);
3926  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3927  __Pyx_AddTraceback("csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
3928  __pyx_r = NULL;
3929  __pyx_L0:;
3930  __Pyx_XGIVEREF(__pyx_r);
3931  __Pyx_RefNannyFinishContext();
3932  return __pyx_r;
3933 }
3934 
3935 /* "csmoothers.pyx":96
3936  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M)
3937  *
3938  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
3939  * double w,
3940  * double tol,
3941  */
3942 
3943 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
3944  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3945  __Pyx_RefNannyDeclarations
3946  PyObject *__pyx_t_1 = NULL;
3947  int __pyx_t_2;
3948  Py_ssize_t __pyx_t_3;
3949  __Pyx_RefNannySetupContext("smootherWrappersjacobi_NR_prepare", 0);
3950 
3951  /* "csmoothers.pyx":101
3952  * DDATA M):
3953  * cdef SuperMatrix AS
3954  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
3955  * AS.Dtype = superluWrappers._SLU_D
3956  * AS.Mtype = superluWrappers._SLU_GE
3957  */
3958  __pyx_v_AS.Stype = SLU_NR;
3959 
3960  /* "csmoothers.pyx":102
3961  * cdef SuperMatrix AS
3962  * AS.Stype = superluWrappers._SLU_NR
3963  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
3964  * AS.Mtype = superluWrappers._SLU_GE
3965  * AS.nrow = sm.nr
3966  */
3967  __pyx_v_AS.Dtype = SLU_D;
3968 
3969  /* "csmoothers.pyx":103
3970  * AS.Stype = superluWrappers._SLU_NR
3971  * AS.Dtype = superluWrappers._SLU_D
3972  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
3973  * AS.nrow = sm.nr
3974  * AS.ncol = sm.nc
3975  */
3976  __pyx_v_AS.Mtype = SLU_GE;
3977 
3978  /* "csmoothers.pyx":104
3979  * AS.Dtype = superluWrappers._SLU_D
3980  * AS.Mtype = superluWrappers._SLU_GE
3981  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
3982  * AS.ncol = sm.nc
3983  * AS.Store = &sm.A
3984  */
3985  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
3986  __Pyx_GOTREF(__pyx_t_1);
3987  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
3988  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3989  __pyx_v_AS.nrow = __pyx_t_2;
3990 
3991  /* "csmoothers.pyx":105
3992  * AS.Mtype = superluWrappers._SLU_GE
3993  * AS.nrow = sm.nr
3994  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
3995  * AS.Store = &sm.A
3996  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
3997  */
3998  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
3999  __Pyx_GOTREF(__pyx_t_1);
4000  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
4001  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4002  __pyx_v_AS.ncol = __pyx_t_2;
4003 
4004  /* "csmoothers.pyx":106
4005  * AS.nrow = sm.nr
4006  * AS.ncol = sm.nc
4007  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4008  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4009  *
4010  */
4011  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4012 
4013  /* "csmoothers.pyx":107
4014  * AS.ncol = sm.nc
4015  * AS.Store = &sm.A
4016  * cjacobi_NR_prepare(&AS, w, tol, &M[0]) # <<<<<<<<<<<<<<
4017  *
4018  * def jacobi_NR_solve(A, M, R, node_order, dX):
4019  */
4020  __pyx_t_3 = 0;
4021  __pyx_t_2 = -1;
4022  if (__pyx_t_3 < 0) {
4023  __pyx_t_3 += __pyx_v_M.shape[0];
4024  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4025  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4026  if (unlikely(__pyx_t_2 != -1)) {
4027  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4028  __PYX_ERR(0, 107, __pyx_L1_error)
4029  }
4030  jacobi_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
4031 
4032  /* "csmoothers.pyx":96
4033  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M)
4034  *
4035  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4036  * double w,
4037  * double tol,
4038  */
4039 
4040  /* function exit code */
4041  goto __pyx_L0;
4042  __pyx_L1_error:;
4043  __Pyx_XDECREF(__pyx_t_1);
4044  __Pyx_WriteUnraisable("csmoothers.smootherWrappersjacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4045  __pyx_L0:;
4046  __Pyx_RefNannyFinishContext();
4047 }
4048 
4049 /* "csmoothers.pyx":109
4050  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4051  *
4052  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
4053  * """
4054  *
4055  */
4056 
4057 /* Python wrapper */
4058 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4059 static char __pyx_doc_10csmoothers_2jacobi_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
4060 static PyMethodDef __pyx_mdef_10csmoothers_3jacobi_NR_solve = {"jacobi_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_3jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_2jacobi_NR_solve};
4061 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4062  PyObject *__pyx_v_A = 0;
4063  PyObject *__pyx_v_M = 0;
4064  PyObject *__pyx_v_R = 0;
4065  PyObject *__pyx_v_node_order = 0;
4066  PyObject *__pyx_v_dX = 0;
4067  PyObject *__pyx_r = 0;
4068  __Pyx_RefNannyDeclarations
4069  __Pyx_RefNannySetupContext("jacobi_NR_solve (wrapper)", 0);
4070  {
4071  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
4072  PyObject* values[5] = {0,0,0,0,0};
4073  if (unlikely(__pyx_kwds)) {
4074  Py_ssize_t kw_args;
4075  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4076  switch (pos_args) {
4077  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4078  CYTHON_FALLTHROUGH;
4079  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4080  CYTHON_FALLTHROUGH;
4081  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4082  CYTHON_FALLTHROUGH;
4083  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4084  CYTHON_FALLTHROUGH;
4085  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4086  CYTHON_FALLTHROUGH;
4087  case 0: break;
4088  default: goto __pyx_L5_argtuple_error;
4089  }
4090  kw_args = PyDict_Size(__pyx_kwds);
4091  switch (pos_args) {
4092  case 0:
4093  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4094  else goto __pyx_L5_argtuple_error;
4095  CYTHON_FALLTHROUGH;
4096  case 1:
4097  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4098  else {
4099  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 109, __pyx_L3_error)
4100  }
4101  CYTHON_FALLTHROUGH;
4102  case 2:
4103  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4104  else {
4105  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 109, __pyx_L3_error)
4106  }
4107  CYTHON_FALLTHROUGH;
4108  case 3:
4109  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4110  else {
4111  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 109, __pyx_L3_error)
4112  }
4113  CYTHON_FALLTHROUGH;
4114  case 4:
4115  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4116  else {
4117  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 109, __pyx_L3_error)
4118  }
4119  }
4120  if (unlikely(kw_args > 0)) {
4121  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "jacobi_NR_solve") < 0)) __PYX_ERR(0, 109, __pyx_L3_error)
4122  }
4123  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4124  goto __pyx_L5_argtuple_error;
4125  } else {
4126  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4127  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4128  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4129  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4130  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4131  }
4132  __pyx_v_A = values[0];
4133  __pyx_v_M = values[1];
4134  __pyx_v_R = values[2];
4135  __pyx_v_node_order = values[3];
4136  __pyx_v_dX = values[4];
4137  }
4138  goto __pyx_L4_argument_unpacking_done;
4139  __pyx_L5_argtuple_error:;
4140  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 109, __pyx_L3_error)
4141  __pyx_L3_error:;
4142  __Pyx_AddTraceback("csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4143  __Pyx_RefNannyFinishContext();
4144  return NULL;
4145  __pyx_L4_argument_unpacking_done:;
4146  __pyx_r = __pyx_pf_10csmoothers_2jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
4147 
4148  /* function exit code */
4149  __Pyx_RefNannyFinishContext();
4150  return __pyx_r;
4151 }
4152 
4153 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
4154  PyObject *__pyx_r = NULL;
4155  __Pyx_RefNannyDeclarations
4156  PyObject *__pyx_t_1 = NULL;
4157  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4158  __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4159  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4160  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4161  __Pyx_RefNannySetupContext("jacobi_NR_solve", 0);
4162 
4163  /* "csmoothers.pyx":120
4164  * dX : np.array double
4165  * """
4166  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX) # <<<<<<<<<<<<<<
4167  *
4168  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm,
4169  */
4170  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
4171  __Pyx_GOTREF(__pyx_t_1);
4172  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 120, __pyx_L1_error)
4173  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4174  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4175  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4176  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4177  __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
4178  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4179  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4180  __pyx_t_2.memview = NULL;
4181  __pyx_t_2.data = NULL;
4182  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4183  __pyx_t_3.memview = NULL;
4184  __pyx_t_3.data = NULL;
4185  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4186  __pyx_t_4.memview = NULL;
4187  __pyx_t_4.data = NULL;
4188  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4189  __pyx_t_5.memview = NULL;
4190  __pyx_t_5.data = NULL;
4191 
4192  /* "csmoothers.pyx":109
4193  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4194  *
4195  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
4196  * """
4197  *
4198  */
4199 
4200  /* function exit code */
4201  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4202  goto __pyx_L0;
4203  __pyx_L1_error:;
4204  __Pyx_XDECREF(__pyx_t_1);
4205  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4206  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4207  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4208  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4209  __Pyx_AddTraceback("csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4210  __pyx_r = NULL;
4211  __pyx_L0:;
4212  __Pyx_XGIVEREF(__pyx_r);
4213  __Pyx_RefNannyFinishContext();
4214  return __pyx_r;
4215 }
4216 
4217 /* "csmoothers.pyx":122
4218  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
4219  *
4220  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4221  * DDATA M,
4222  * DDATA R,
4223  */
4224 
4225 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4226  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4227  __Pyx_RefNannyDeclarations
4228  PyObject *__pyx_t_1 = NULL;
4229  int __pyx_t_2;
4230  Py_ssize_t __pyx_t_3;
4231  Py_ssize_t __pyx_t_4;
4232  Py_ssize_t __pyx_t_5;
4233  Py_ssize_t __pyx_t_6;
4234  __Pyx_RefNannySetupContext("smootherWrappersjacobi_NR_solve", 0);
4235 
4236  /* "csmoothers.pyx":128
4237  * DDATA dX):
4238  * cdef SuperMatrix AS
4239  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4240  * AS.Dtype = superluWrappers._SLU_D
4241  * AS.Mtype = superluWrappers._SLU_GE
4242  */
4243  __pyx_v_AS.Stype = SLU_NR;
4244 
4245  /* "csmoothers.pyx":129
4246  * cdef SuperMatrix AS
4247  * AS.Stype = superluWrappers._SLU_NR
4248  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4249  * AS.Mtype = superluWrappers._SLU_GE
4250  * AS.nrow = sm.nr
4251  */
4252  __pyx_v_AS.Dtype = SLU_D;
4253 
4254  /* "csmoothers.pyx":130
4255  * AS.Stype = superluWrappers._SLU_NR
4256  * AS.Dtype = superluWrappers._SLU_D
4257  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4258  * AS.nrow = sm.nr
4259  * AS.ncol = sm.nc
4260  */
4261  __pyx_v_AS.Mtype = SLU_GE;
4262 
4263  /* "csmoothers.pyx":131
4264  * AS.Dtype = superluWrappers._SLU_D
4265  * AS.Mtype = superluWrappers._SLU_GE
4266  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4267  * AS.ncol = sm.nc
4268  * AS.Store = &sm.A
4269  */
4270  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
4271  __Pyx_GOTREF(__pyx_t_1);
4272  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
4273  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4274  __pyx_v_AS.nrow = __pyx_t_2;
4275 
4276  /* "csmoothers.pyx":132
4277  * AS.Mtype = superluWrappers._SLU_GE
4278  * AS.nrow = sm.nr
4279  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4280  * AS.Store = &sm.A
4281  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4282  */
4283  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
4284  __Pyx_GOTREF(__pyx_t_1);
4285  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
4286  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4287  __pyx_v_AS.ncol = __pyx_t_2;
4288 
4289  /* "csmoothers.pyx":133
4290  * AS.nrow = sm.nr
4291  * AS.ncol = sm.nc
4292  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4293  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4294  *
4295  */
4296  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4297 
4298  /* "csmoothers.pyx":134
4299  * AS.ncol = sm.nc
4300  * AS.Store = &sm.A
4301  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0]) # <<<<<<<<<<<<<<
4302  *
4303  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX):
4304  */
4305  __pyx_t_3 = 0;
4306  __pyx_t_2 = -1;
4307  if (__pyx_t_3 < 0) {
4308  __pyx_t_3 += __pyx_v_M.shape[0];
4309  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4310  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4311  if (unlikely(__pyx_t_2 != -1)) {
4312  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4313  __PYX_ERR(0, 134, __pyx_L1_error)
4314  }
4315  __pyx_t_4 = 0;
4316  __pyx_t_2 = -1;
4317  if (__pyx_t_4 < 0) {
4318  __pyx_t_4 += __pyx_v_R.shape[0];
4319  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4320  } else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4321  if (unlikely(__pyx_t_2 != -1)) {
4322  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4323  __PYX_ERR(0, 134, __pyx_L1_error)
4324  }
4325  __pyx_t_5 = 0;
4326  __pyx_t_2 = -1;
4327  if (__pyx_t_5 < 0) {
4328  __pyx_t_5 += __pyx_v_node_order.shape[0];
4329  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4330  } else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4331  if (unlikely(__pyx_t_2 != -1)) {
4332  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4333  __PYX_ERR(0, 134, __pyx_L1_error)
4334  }
4335  __pyx_t_6 = 0;
4336  __pyx_t_2 = -1;
4337  if (__pyx_t_6 < 0) {
4338  __pyx_t_6 += __pyx_v_dX.shape[0];
4339  if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
4340  } else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4341  if (unlikely(__pyx_t_2 != -1)) {
4342  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4343  __PYX_ERR(0, 134, __pyx_L1_error)
4344  }
4345  jacobi_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
4346 
4347  /* "csmoothers.pyx":122
4348  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
4349  *
4350  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4351  * DDATA M,
4352  * DDATA R,
4353  */
4354 
4355  /* function exit code */
4356  goto __pyx_L0;
4357  __pyx_L1_error:;
4358  __Pyx_XDECREF(__pyx_t_1);
4359  __Pyx_WriteUnraisable("csmoothers.smootherWrappersjacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4360  __pyx_L0:;
4361  __Pyx_RefNannyFinishContext();
4362 }
4363 
4364 /* "csmoothers.pyx":136
4365  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4366  *
4367  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
4368  * """
4369  *
4370  */
4371 
4372 /* Python wrapper */
4373 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4374 static char __pyx_doc_10csmoothers_4nl_jacobi_NR_solve[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : np.float\n tol : np.float\n dX : np.array double\n ";
4375 static PyMethodDef __pyx_mdef_10csmoothers_5nl_jacobi_NR_solve = {"nl_jacobi_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_5nl_jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_4nl_jacobi_NR_solve};
4376 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4377  PyObject *__pyx_v_A = 0;
4378  PyObject *__pyx_v_R = 0;
4379  PyObject *__pyx_v_node_order = 0;
4380  PyObject *__pyx_v_w = 0;
4381  PyObject *__pyx_v_tol = 0;
4382  PyObject *__pyx_v_dX = 0;
4383  PyObject *__pyx_r = 0;
4384  __Pyx_RefNannyDeclarations
4385  __Pyx_RefNannySetupContext("nl_jacobi_NR_solve (wrapper)", 0);
4386  {
4387  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
4388  PyObject* values[6] = {0,0,0,0,0,0};
4389  if (unlikely(__pyx_kwds)) {
4390  Py_ssize_t kw_args;
4391  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4392  switch (pos_args) {
4393  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4394  CYTHON_FALLTHROUGH;
4395  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4396  CYTHON_FALLTHROUGH;
4397  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4398  CYTHON_FALLTHROUGH;
4399  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4400  CYTHON_FALLTHROUGH;
4401  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4402  CYTHON_FALLTHROUGH;
4403  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4404  CYTHON_FALLTHROUGH;
4405  case 0: break;
4406  default: goto __pyx_L5_argtuple_error;
4407  }
4408  kw_args = PyDict_Size(__pyx_kwds);
4409  switch (pos_args) {
4410  case 0:
4411  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4412  else goto __pyx_L5_argtuple_error;
4413  CYTHON_FALLTHROUGH;
4414  case 1:
4415  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4416  else {
4417  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 136, __pyx_L3_error)
4418  }
4419  CYTHON_FALLTHROUGH;
4420  case 2:
4421  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4422  else {
4423  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 136, __pyx_L3_error)
4424  }
4425  CYTHON_FALLTHROUGH;
4426  case 3:
4427  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4428  else {
4429  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 136, __pyx_L3_error)
4430  }
4431  CYTHON_FALLTHROUGH;
4432  case 4:
4433  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4434  else {
4435  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 136, __pyx_L3_error)
4436  }
4437  CYTHON_FALLTHROUGH;
4438  case 5:
4439  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4440  else {
4441  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 136, __pyx_L3_error)
4442  }
4443  }
4444  if (unlikely(kw_args > 0)) {
4445  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nl_jacobi_NR_solve") < 0)) __PYX_ERR(0, 136, __pyx_L3_error)
4446  }
4447  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4448  goto __pyx_L5_argtuple_error;
4449  } else {
4450  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4451  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4452  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4453  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4454  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4455  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4456  }
4457  __pyx_v_A = values[0];
4458  __pyx_v_R = values[1];
4459  __pyx_v_node_order = values[2];
4460  __pyx_v_w = values[3];
4461  __pyx_v_tol = values[4];
4462  __pyx_v_dX = values[5];
4463  }
4464  goto __pyx_L4_argument_unpacking_done;
4465  __pyx_L5_argtuple_error:;
4466  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error)
4467  __pyx_L3_error:;
4468  __Pyx_AddTraceback("csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4469  __Pyx_RefNannyFinishContext();
4470  return NULL;
4471  __pyx_L4_argument_unpacking_done:;
4472  __pyx_r = __pyx_pf_10csmoothers_4nl_jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
4473 
4474  /* function exit code */
4475  __Pyx_RefNannyFinishContext();
4476  return __pyx_r;
4477 }
4478 
4479 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
4480  PyObject *__pyx_r = NULL;
4481  __Pyx_RefNannyDeclarations
4482  PyObject *__pyx_t_1 = NULL;
4483  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4484  __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4485  double __pyx_t_4;
4486  double __pyx_t_5;
4487  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4488  __Pyx_RefNannySetupContext("nl_jacobi_NR_solve", 0);
4489 
4490  /* "csmoothers.pyx":148
4491  * dX : np.array double
4492  * """
4493  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX) # <<<<<<<<<<<<<<
4494  *
4495  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm,
4496  */
4497  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
4498  __Pyx_GOTREF(__pyx_t_1);
4499  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 148, __pyx_L1_error)
4500  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4501  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4502  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4503  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4504  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4505  __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
4506  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4507  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4508  __pyx_t_2.memview = NULL;
4509  __pyx_t_2.data = NULL;
4510  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4511  __pyx_t_3.memview = NULL;
4512  __pyx_t_3.data = NULL;
4513  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4514  __pyx_t_6.memview = NULL;
4515  __pyx_t_6.data = NULL;
4516 
4517  /* "csmoothers.pyx":136
4518  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4519  *
4520  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
4521  * """
4522  *
4523  */
4524 
4525  /* function exit code */
4526  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4527  goto __pyx_L0;
4528  __pyx_L1_error:;
4529  __Pyx_XDECREF(__pyx_t_1);
4530  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4531  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4532  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4533  __Pyx_AddTraceback("csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4534  __pyx_r = NULL;
4535  __pyx_L0:;
4536  __Pyx_XGIVEREF(__pyx_r);
4537  __Pyx_RefNannyFinishContext();
4538  return __pyx_r;
4539 }
4540 
4541 /* "csmoothers.pyx":150
4542  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX)
4543  *
4544  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4545  * DDATA R,
4546  * IDATA node_order,
4547  */
4548 
4549 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4550  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4551  __Pyx_RefNannyDeclarations
4552  PyObject *__pyx_t_1 = NULL;
4553  int __pyx_t_2;
4554  Py_ssize_t __pyx_t_3;
4555  Py_ssize_t __pyx_t_4;
4556  Py_ssize_t __pyx_t_5;
4557  __Pyx_RefNannySetupContext("smootherWrappersnl_jacobi_NR_solve", 0);
4558 
4559  /* "csmoothers.pyx":157
4560  * DDATA dX):
4561  * cdef SuperMatrix AS
4562  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4563  * AS.Dtype = superluWrappers._SLU_D
4564  * AS.Mtype = superluWrappers._SLU_GE
4565  */
4566  __pyx_v_AS.Stype = SLU_NR;
4567 
4568  /* "csmoothers.pyx":158
4569  * cdef SuperMatrix AS
4570  * AS.Stype = superluWrappers._SLU_NR
4571  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4572  * AS.Mtype = superluWrappers._SLU_GE
4573  * AS.nrow = sm.nr
4574  */
4575  __pyx_v_AS.Dtype = SLU_D;
4576 
4577  /* "csmoothers.pyx":159
4578  * AS.Stype = superluWrappers._SLU_NR
4579  * AS.Dtype = superluWrappers._SLU_D
4580  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4581  * AS.nrow = sm.nr
4582  * AS.ncol = sm.nc
4583  */
4584  __pyx_v_AS.Mtype = SLU_GE;
4585 
4586  /* "csmoothers.pyx":160
4587  * AS.Dtype = superluWrappers._SLU_D
4588  * AS.Mtype = superluWrappers._SLU_GE
4589  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4590  * AS.ncol = sm.nc
4591  * AS.Store = &sm.A
4592  */
4593  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
4594  __Pyx_GOTREF(__pyx_t_1);
4595  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
4596  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4597  __pyx_v_AS.nrow = __pyx_t_2;
4598 
4599  /* "csmoothers.pyx":161
4600  * AS.Mtype = superluWrappers._SLU_GE
4601  * AS.nrow = sm.nr
4602  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4603  * AS.Store = &sm.A
4604  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4605  */
4606  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
4607  __Pyx_GOTREF(__pyx_t_1);
4608  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
4609  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4610  __pyx_v_AS.ncol = __pyx_t_2;
4611 
4612  /* "csmoothers.pyx":162
4613  * AS.nrow = sm.nr
4614  * AS.ncol = sm.nc
4615  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4616  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4617  *
4618  */
4619  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4620 
4621  /* "csmoothers.pyx":163
4622  * AS.ncol = sm.nc
4623  * AS.Store = &sm.A
4624  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0]) # <<<<<<<<<<<<<<
4625  *
4626  * def gauss_seidel_NR_preare(A, w, tol, M):
4627  */
4628  __pyx_t_3 = 0;
4629  __pyx_t_2 = -1;
4630  if (__pyx_t_3 < 0) {
4631  __pyx_t_3 += __pyx_v_R.shape[0];
4632  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4633  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4634  if (unlikely(__pyx_t_2 != -1)) {
4635  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4636  __PYX_ERR(0, 163, __pyx_L1_error)
4637  }
4638  __pyx_t_4 = 0;
4639  __pyx_t_2 = -1;
4640  if (__pyx_t_4 < 0) {
4641  __pyx_t_4 += __pyx_v_node_order.shape[0];
4642  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4643  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4644  if (unlikely(__pyx_t_2 != -1)) {
4645  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4646  __PYX_ERR(0, 163, __pyx_L1_error)
4647  }
4648  __pyx_t_5 = 0;
4649  __pyx_t_2 = -1;
4650  if (__pyx_t_5 < 0) {
4651  __pyx_t_5 += __pyx_v_dX.shape[0];
4652  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4653  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4654  if (unlikely(__pyx_t_2 != -1)) {
4655  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4656  __PYX_ERR(0, 163, __pyx_L1_error)
4657  }
4658  nl_jacobi_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
4659 
4660  /* "csmoothers.pyx":150
4661  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX)
4662  *
4663  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4664  * DDATA R,
4665  * IDATA node_order,
4666  */
4667 
4668  /* function exit code */
4669  goto __pyx_L0;
4670  __pyx_L1_error:;
4671  __Pyx_XDECREF(__pyx_t_1);
4672  __Pyx_WriteUnraisable("csmoothers.smootherWrappersnl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4673  __pyx_L0:;
4674  __Pyx_RefNannyFinishContext();
4675 }
4676 
4677 /* "csmoothers.pyx":165
4678  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4679  *
4680  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
4681  * """
4682  *
4683  */
4684 
4685 /* Python wrapper */
4686 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4687 static char __pyx_doc_10csmoothers_6gauss_seidel_NR_preare[] = "\n\n Arguments\n ---------\n A :\n w :\n tol :\n M :\n ";
4688 static PyMethodDef __pyx_mdef_10csmoothers_7gauss_seidel_NR_preare = {"gauss_seidel_NR_preare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_7gauss_seidel_NR_preare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_6gauss_seidel_NR_preare};
4689 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4690  PyObject *__pyx_v_A = 0;
4691  PyObject *__pyx_v_w = 0;
4692  PyObject *__pyx_v_tol = 0;
4693  PyObject *__pyx_v_M = 0;
4694  PyObject *__pyx_r = 0;
4695  __Pyx_RefNannyDeclarations
4696  __Pyx_RefNannySetupContext("gauss_seidel_NR_preare (wrapper)", 0);
4697  {
4698  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
4699  PyObject* values[4] = {0,0,0,0};
4700  if (unlikely(__pyx_kwds)) {
4701  Py_ssize_t kw_args;
4702  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4703  switch (pos_args) {
4704  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4705  CYTHON_FALLTHROUGH;
4706  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4707  CYTHON_FALLTHROUGH;
4708  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4709  CYTHON_FALLTHROUGH;
4710  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4711  CYTHON_FALLTHROUGH;
4712  case 0: break;
4713  default: goto __pyx_L5_argtuple_error;
4714  }
4715  kw_args = PyDict_Size(__pyx_kwds);
4716  switch (pos_args) {
4717  case 0:
4718  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4719  else goto __pyx_L5_argtuple_error;
4720  CYTHON_FALLTHROUGH;
4721  case 1:
4722  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4723  else {
4724  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 1); __PYX_ERR(0, 165, __pyx_L3_error)
4725  }
4726  CYTHON_FALLTHROUGH;
4727  case 2:
4728  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4729  else {
4730  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 2); __PYX_ERR(0, 165, __pyx_L3_error)
4731  }
4732  CYTHON_FALLTHROUGH;
4733  case 3:
4734  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4735  else {
4736  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 3); __PYX_ERR(0, 165, __pyx_L3_error)
4737  }
4738  }
4739  if (unlikely(kw_args > 0)) {
4740  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gauss_seidel_NR_preare") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
4741  }
4742  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4743  goto __pyx_L5_argtuple_error;
4744  } else {
4745  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4746  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4747  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4748  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4749  }
4750  __pyx_v_A = values[0];
4751  __pyx_v_w = values[1];
4752  __pyx_v_tol = values[2];
4753  __pyx_v_M = values[3];
4754  }
4755  goto __pyx_L4_argument_unpacking_done;
4756  __pyx_L5_argtuple_error:;
4757  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
4758  __pyx_L3_error:;
4759  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4760  __Pyx_RefNannyFinishContext();
4761  return NULL;
4762  __pyx_L4_argument_unpacking_done:;
4763  __pyx_r = __pyx_pf_10csmoothers_6gauss_seidel_NR_preare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
4764 
4765  /* function exit code */
4766  __Pyx_RefNannyFinishContext();
4767  return __pyx_r;
4768 }
4769 
4770 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
4771  PyObject *__pyx_r = NULL;
4772  __Pyx_RefNannyDeclarations
4773  PyObject *__pyx_t_1 = NULL;
4774  double __pyx_t_2;
4775  double __pyx_t_3;
4776  __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4777  __Pyx_RefNannySetupContext("gauss_seidel_NR_preare", 0);
4778 
4779  /* "csmoothers.pyx":175
4780  * M :
4781  * """
4782  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M) # <<<<<<<<<<<<<<
4783  *
4784  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm,
4785  */
4786  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
4787  __Pyx_GOTREF(__pyx_t_1);
4788  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 175, __pyx_L1_error)
4789  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4790  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4791  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 175, __pyx_L1_error)
4792  __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
4793  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4794  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4795  __pyx_t_4.memview = NULL;
4796  __pyx_t_4.data = NULL;
4797 
4798  /* "csmoothers.pyx":165
4799  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4800  *
4801  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
4802  * """
4803  *
4804  */
4805 
4806  /* function exit code */
4807  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4808  goto __pyx_L0;
4809  __pyx_L1_error:;
4810  __Pyx_XDECREF(__pyx_t_1);
4811  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4812  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4813  __pyx_r = NULL;
4814  __pyx_L0:;
4815  __Pyx_XGIVEREF(__pyx_r);
4816  __Pyx_RefNannyFinishContext();
4817  return __pyx_r;
4818 }
4819 
4820 /* "csmoothers.pyx":177
4821  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M)
4822  *
4823  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4824  * double w,
4825  * double tol,
4826  */
4827 
4828 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
4829  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4830  __Pyx_RefNannyDeclarations
4831  PyObject *__pyx_t_1 = NULL;
4832  int __pyx_t_2;
4833  Py_ssize_t __pyx_t_3;
4834  __Pyx_RefNannySetupContext("smootherWrappersgauss_seidel_NR_prepare", 0);
4835 
4836  /* "csmoothers.pyx":182
4837  * DDATA M):
4838  * cdef SuperMatrix AS
4839  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4840  * AS.Dtype = superluWrappers._SLU_D
4841  * AS.Mtype = superluWrappers._SLU_GE
4842  */
4843  __pyx_v_AS.Stype = SLU_NR;
4844 
4845  /* "csmoothers.pyx":183
4846  * cdef SuperMatrix AS
4847  * AS.Stype = superluWrappers._SLU_NR
4848  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4849  * AS.Mtype = superluWrappers._SLU_GE
4850  * AS.nrow = sm.nr
4851  */
4852  __pyx_v_AS.Dtype = SLU_D;
4853 
4854  /* "csmoothers.pyx":184
4855  * AS.Stype = superluWrappers._SLU_NR
4856  * AS.Dtype = superluWrappers._SLU_D
4857  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4858  * AS.nrow = sm.nr
4859  * AS.ncol = sm.nc
4860  */
4861  __pyx_v_AS.Mtype = SLU_GE;
4862 
4863  /* "csmoothers.pyx":185
4864  * AS.Dtype = superluWrappers._SLU_D
4865  * AS.Mtype = superluWrappers._SLU_GE
4866  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4867  * AS.ncol = sm.nc
4868  * AS.Store = &sm.A
4869  */
4870  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
4871  __Pyx_GOTREF(__pyx_t_1);
4872  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
4873  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4874  __pyx_v_AS.nrow = __pyx_t_2;
4875 
4876  /* "csmoothers.pyx":186
4877  * AS.Mtype = superluWrappers._SLU_GE
4878  * AS.nrow = sm.nr
4879  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4880  * AS.Store = &sm.A
4881  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
4882  */
4883  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
4884  __Pyx_GOTREF(__pyx_t_1);
4885  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
4886  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4887  __pyx_v_AS.ncol = __pyx_t_2;
4888 
4889  /* "csmoothers.pyx":187
4890  * AS.nrow = sm.nr
4891  * AS.ncol = sm.nc
4892  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4893  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
4894  *
4895  */
4896  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4897 
4898  /* "csmoothers.pyx":188
4899  * AS.ncol = sm.nc
4900  * AS.Store = &sm.A
4901  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0]) # <<<<<<<<<<<<<<
4902  *
4903  * def gauss_seidel_NR_solve(A, M, R, node_order, dX):
4904  */
4905  __pyx_t_3 = 0;
4906  __pyx_t_2 = -1;
4907  if (__pyx_t_3 < 0) {
4908  __pyx_t_3 += __pyx_v_M.shape[0];
4909  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4910  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4911  if (unlikely(__pyx_t_2 != -1)) {
4912  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4913  __PYX_ERR(0, 188, __pyx_L1_error)
4914  }
4915  gauss_seidel_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
4916 
4917  /* "csmoothers.pyx":177
4918  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M)
4919  *
4920  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4921  * double w,
4922  * double tol,
4923  */
4924 
4925  /* function exit code */
4926  goto __pyx_L0;
4927  __pyx_L1_error:;
4928  __Pyx_XDECREF(__pyx_t_1);
4929  __Pyx_WriteUnraisable("csmoothers.smootherWrappersgauss_seidel_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4930  __pyx_L0:;
4931  __Pyx_RefNannyFinishContext();
4932 }
4933 
4934 /* "csmoothers.pyx":190
4935  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
4936  *
4937  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
4938  * """
4939  *
4940  */
4941 
4942 /* Python wrapper */
4943 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4944 static char __pyx_doc_10csmoothers_8gauss_seidel_NR_solve[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
4945 static PyMethodDef __pyx_mdef_10csmoothers_9gauss_seidel_NR_solve = {"gauss_seidel_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_8gauss_seidel_NR_solve};
4946 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4947  PyObject *__pyx_v_A = 0;
4948  PyObject *__pyx_v_M = 0;
4949  PyObject *__pyx_v_R = 0;
4950  PyObject *__pyx_v_node_order = 0;
4951  PyObject *__pyx_v_dX = 0;
4952  PyObject *__pyx_r = 0;
4953  __Pyx_RefNannyDeclarations
4954  __Pyx_RefNannySetupContext("gauss_seidel_NR_solve (wrapper)", 0);
4955  {
4956  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
4957  PyObject* values[5] = {0,0,0,0,0};
4958  if (unlikely(__pyx_kwds)) {
4959  Py_ssize_t kw_args;
4960  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4961  switch (pos_args) {
4962  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4963  CYTHON_FALLTHROUGH;
4964  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4965  CYTHON_FALLTHROUGH;
4966  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4967  CYTHON_FALLTHROUGH;
4968  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4969  CYTHON_FALLTHROUGH;
4970  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4971  CYTHON_FALLTHROUGH;
4972  case 0: break;
4973  default: goto __pyx_L5_argtuple_error;
4974  }
4975  kw_args = PyDict_Size(__pyx_kwds);
4976  switch (pos_args) {
4977  case 0:
4978  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4979  else goto __pyx_L5_argtuple_error;
4980  CYTHON_FALLTHROUGH;
4981  case 1:
4982  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4983  else {
4984  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 190, __pyx_L3_error)
4985  }
4986  CYTHON_FALLTHROUGH;
4987  case 2:
4988  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4989  else {
4990  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 190, __pyx_L3_error)
4991  }
4992  CYTHON_FALLTHROUGH;
4993  case 3:
4994  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4995  else {
4996  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 190, __pyx_L3_error)
4997  }
4998  CYTHON_FALLTHROUGH;
4999  case 4:
5000  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5001  else {
5002  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 190, __pyx_L3_error)
5003  }
5004  }
5005  if (unlikely(kw_args > 0)) {
5006  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 190, __pyx_L3_error)
5007  }
5008  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5009  goto __pyx_L5_argtuple_error;
5010  } else {
5011  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5012  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5013  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5014  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5015  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5016  }
5017  __pyx_v_A = values[0];
5018  __pyx_v_M = values[1];
5019  __pyx_v_R = values[2];
5020  __pyx_v_node_order = values[3];
5021  __pyx_v_dX = values[4];
5022  }
5023  goto __pyx_L4_argument_unpacking_done;
5024  __pyx_L5_argtuple_error:;
5025  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 190, __pyx_L3_error)
5026  __pyx_L3_error:;
5027  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5028  __Pyx_RefNannyFinishContext();
5029  return NULL;
5030  __pyx_L4_argument_unpacking_done:;
5031  __pyx_r = __pyx_pf_10csmoothers_8gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
5032 
5033  /* function exit code */
5034  __Pyx_RefNannyFinishContext();
5035  return __pyx_r;
5036 }
5037 
5038 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
5039  PyObject *__pyx_r = NULL;
5040  __Pyx_RefNannyDeclarations
5041  PyObject *__pyx_t_1 = NULL;
5042  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5043  __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5044  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
5045  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
5046  __Pyx_RefNannySetupContext("gauss_seidel_NR_solve", 0);
5047 
5048  /* "csmoothers.pyx":201
5049  * dX : np.array double
5050  * """
5051  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX) # <<<<<<<<<<<<<<
5052  *
5053  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm,
5054  */
5055  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
5056  __Pyx_GOTREF(__pyx_t_1);
5057  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 201, __pyx_L1_error)
5058  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5059  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5060  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5061  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5062  __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
5063  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5064  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5065  __pyx_t_2.memview = NULL;
5066  __pyx_t_2.data = NULL;
5067  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5068  __pyx_t_3.memview = NULL;
5069  __pyx_t_3.data = NULL;
5070  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5071  __pyx_t_4.memview = NULL;
5072  __pyx_t_4.data = NULL;
5073  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5074  __pyx_t_5.memview = NULL;
5075  __pyx_t_5.data = NULL;
5076 
5077  /* "csmoothers.pyx":190
5078  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
5079  *
5080  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
5081  * """
5082  *
5083  */
5084 
5085  /* function exit code */
5086  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5087  goto __pyx_L0;
5088  __pyx_L1_error:;
5089  __Pyx_XDECREF(__pyx_t_1);
5090  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5091  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5092  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5093  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5094  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5095  __pyx_r = NULL;
5096  __pyx_L0:;
5097  __Pyx_XGIVEREF(__pyx_r);
5098  __Pyx_RefNannyFinishContext();
5099  return __pyx_r;
5100 }
5101 
5102 /* "csmoothers.pyx":203
5103  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
5104  *
5105  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5106  * DDATA M,
5107  * DDATA R,
5108  */
5109 
5110 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5111  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5112  __Pyx_RefNannyDeclarations
5113  PyObject *__pyx_t_1 = NULL;
5114  int __pyx_t_2;
5115  Py_ssize_t __pyx_t_3;
5116  Py_ssize_t __pyx_t_4;
5117  Py_ssize_t __pyx_t_5;
5118  Py_ssize_t __pyx_t_6;
5119  __Pyx_RefNannySetupContext("smootherWrappersgauss_seidel_NR_solve", 0);
5120 
5121  /* "csmoothers.pyx":209
5122  * DDATA dX):
5123  * cdef SuperMatrix AS
5124  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5125  * AS.Dtype = superluWrappers._SLU_D
5126  * AS.Mtype = superluWrappers._SLU_GE
5127  */
5128  __pyx_v_AS.Stype = SLU_NR;
5129 
5130  /* "csmoothers.pyx":210
5131  * cdef SuperMatrix AS
5132  * AS.Stype = superluWrappers._SLU_NR
5133  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5134  * AS.Mtype = superluWrappers._SLU_GE
5135  * AS.nrow = sm.nr
5136  */
5137  __pyx_v_AS.Dtype = SLU_D;
5138 
5139  /* "csmoothers.pyx":211
5140  * AS.Stype = superluWrappers._SLU_NR
5141  * AS.Dtype = superluWrappers._SLU_D
5142  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5143  * AS.nrow = sm.nr
5144  * AS.ncol = sm.nc
5145  */
5146  __pyx_v_AS.Mtype = SLU_GE;
5147 
5148  /* "csmoothers.pyx":212
5149  * AS.Dtype = superluWrappers._SLU_D
5150  * AS.Mtype = superluWrappers._SLU_GE
5151  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5152  * AS.ncol = sm.nc
5153  * AS.Store = &sm.A
5154  */
5155  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
5156  __Pyx_GOTREF(__pyx_t_1);
5157  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error)
5158  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5159  __pyx_v_AS.nrow = __pyx_t_2;
5160 
5161  /* "csmoothers.pyx":213
5162  * AS.Mtype = superluWrappers._SLU_GE
5163  * AS.nrow = sm.nr
5164  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5165  * AS.Store = &sm.A
5166  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5167  */
5168  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
5169  __Pyx_GOTREF(__pyx_t_1);
5170  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error)
5171  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5172  __pyx_v_AS.ncol = __pyx_t_2;
5173 
5174  /* "csmoothers.pyx":214
5175  * AS.nrow = sm.nr
5176  * AS.ncol = sm.nc
5177  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5178  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5179  *
5180  */
5181  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5182 
5183  /* "csmoothers.pyx":215
5184  * AS.ncol = sm.nc
5185  * AS.Store = &sm.A
5186  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0]) # <<<<<<<<<<<<<<
5187  *
5188  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX):
5189  */
5190  __pyx_t_3 = 0;
5191  __pyx_t_2 = -1;
5192  if (__pyx_t_3 < 0) {
5193  __pyx_t_3 += __pyx_v_M.shape[0];
5194  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5195  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
5196  if (unlikely(__pyx_t_2 != -1)) {
5197  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5198  __PYX_ERR(0, 215, __pyx_L1_error)
5199  }
5200  __pyx_t_4 = 0;
5201  __pyx_t_2 = -1;
5202  if (__pyx_t_4 < 0) {
5203  __pyx_t_4 += __pyx_v_R.shape[0];
5204  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5205  } else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5206  if (unlikely(__pyx_t_2 != -1)) {
5207  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5208  __PYX_ERR(0, 215, __pyx_L1_error)
5209  }
5210  __pyx_t_5 = 0;
5211  __pyx_t_2 = -1;
5212  if (__pyx_t_5 < 0) {
5213  __pyx_t_5 += __pyx_v_node_order.shape[0];
5214  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5215  } else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5216  if (unlikely(__pyx_t_2 != -1)) {
5217  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5218  __PYX_ERR(0, 215, __pyx_L1_error)
5219  }
5220  __pyx_t_6 = 0;
5221  __pyx_t_2 = -1;
5222  if (__pyx_t_6 < 0) {
5223  __pyx_t_6 += __pyx_v_dX.shape[0];
5224  if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
5225  } else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5226  if (unlikely(__pyx_t_2 != -1)) {
5227  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5228  __PYX_ERR(0, 215, __pyx_L1_error)
5229  }
5230  gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
5231 
5232  /* "csmoothers.pyx":203
5233  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
5234  *
5235  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5236  * DDATA M,
5237  * DDATA R,
5238  */
5239 
5240  /* function exit code */
5241  goto __pyx_L0;
5242  __pyx_L1_error:;
5243  __Pyx_XDECREF(__pyx_t_1);
5244  __Pyx_WriteUnraisable("csmoothers.smootherWrappersgauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5245  __pyx_L0:;
5246  __Pyx_RefNannyFinishContext();
5247 }
5248 
5249 /* "csmoothers.pyx":217
5250  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5251  *
5252  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
5253  * """
5254  *
5255  */
5256 
5257 /* Python wrapper */
5258 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5259 static char __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : double\n tol : double\n dX : np.array double\n ";
5260 static PyMethodDef __pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve = {"nl_gauss_seidel_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve};
5261 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5262  PyObject *__pyx_v_A = 0;
5263  PyObject *__pyx_v_R = 0;
5264  PyObject *__pyx_v_node_order = 0;
5265  PyObject *__pyx_v_w = 0;
5266  PyObject *__pyx_v_tol = 0;
5267  PyObject *__pyx_v_dX = 0;
5268  PyObject *__pyx_r = 0;
5269  __Pyx_RefNannyDeclarations
5270  __Pyx_RefNannySetupContext("nl_gauss_seidel_NR_solve (wrapper)", 0);
5271  {
5272  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
5273  PyObject* values[6] = {0,0,0,0,0,0};
5274  if (unlikely(__pyx_kwds)) {
5275  Py_ssize_t kw_args;
5276  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5277  switch (pos_args) {
5278  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5279  CYTHON_FALLTHROUGH;
5280  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5281  CYTHON_FALLTHROUGH;
5282  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5283  CYTHON_FALLTHROUGH;
5284  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5285  CYTHON_FALLTHROUGH;
5286  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5287  CYTHON_FALLTHROUGH;
5288  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5289  CYTHON_FALLTHROUGH;
5290  case 0: break;
5291  default: goto __pyx_L5_argtuple_error;
5292  }
5293  kw_args = PyDict_Size(__pyx_kwds);
5294  switch (pos_args) {
5295  case 0:
5296  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5297  else goto __pyx_L5_argtuple_error;
5298  CYTHON_FALLTHROUGH;
5299  case 1:
5300  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5301  else {
5302  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 217, __pyx_L3_error)
5303  }
5304  CYTHON_FALLTHROUGH;
5305  case 2:
5306  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5307  else {
5308  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 217, __pyx_L3_error)
5309  }
5310  CYTHON_FALLTHROUGH;
5311  case 3:
5312  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
5313  else {
5314  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 217, __pyx_L3_error)
5315  }
5316  CYTHON_FALLTHROUGH;
5317  case 4:
5318  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
5319  else {
5320  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 217, __pyx_L3_error)
5321  }
5322  CYTHON_FALLTHROUGH;
5323  case 5:
5324  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5325  else {
5326  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 217, __pyx_L3_error)
5327  }
5328  }
5329  if (unlikely(kw_args > 0)) {
5330  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nl_gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
5331  }
5332  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5333  goto __pyx_L5_argtuple_error;
5334  } else {
5335  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5336  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5337  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5338  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5339  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5340  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5341  }
5342  __pyx_v_A = values[0];
5343  __pyx_v_R = values[1];
5344  __pyx_v_node_order = values[2];
5345  __pyx_v_w = values[3];
5346  __pyx_v_tol = values[4];
5347  __pyx_v_dX = values[5];
5348  }
5349  goto __pyx_L4_argument_unpacking_done;
5350  __pyx_L5_argtuple_error:;
5351  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
5352  __pyx_L3_error:;
5353  __Pyx_AddTraceback("csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5354  __Pyx_RefNannyFinishContext();
5355  return NULL;
5356  __pyx_L4_argument_unpacking_done:;
5357  __pyx_r = __pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
5358 
5359  /* function exit code */
5360  __Pyx_RefNannyFinishContext();
5361  return __pyx_r;
5362 }
5363 
5364 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
5365  PyObject *__pyx_r = NULL;
5366  __Pyx_RefNannyDeclarations
5367  PyObject *__pyx_t_1 = NULL;
5368  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5369  __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5370  double __pyx_t_4;
5371  double __pyx_t_5;
5372  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5373  PyObject *__pyx_t_7 = NULL;
5374  __Pyx_RefNannySetupContext("nl_gauss_seidel_NR_solve", 0);
5375 
5376  /* "csmoothers.pyx":229
5377  * dX : np.array double
5378  * """
5379  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
5380  * R,
5381  * node_order,
5382  */
5383  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5384  __Pyx_GOTREF(__pyx_t_1);
5385  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5386 
5387  /* "csmoothers.pyx":230
5388  * """
5389  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix,
5390  * R, # <<<<<<<<<<<<<<
5391  * node_order,
5392  * w,
5393  */
5394  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 230, __pyx_L1_error)
5395 
5396  /* "csmoothers.pyx":231
5397  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix,
5398  * R,
5399  * node_order, # <<<<<<<<<<<<<<
5400  * w,
5401  * tol,
5402  */
5403  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 231, __pyx_L1_error)
5404 
5405  /* "csmoothers.pyx":232
5406  * R,
5407  * node_order,
5408  * w, # <<<<<<<<<<<<<<
5409  * tol,
5410  * dX)
5411  */
5412  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
5413 
5414  /* "csmoothers.pyx":233
5415  * node_order,
5416  * w,
5417  * tol, # <<<<<<<<<<<<<<
5418  * dX)
5419  *
5420  */
5421  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
5422 
5423  /* "csmoothers.pyx":234
5424  * w,
5425  * tol,
5426  * dX) # <<<<<<<<<<<<<<
5427  *
5428  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm,
5429  */
5430  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 234, __pyx_L1_error)
5431 
5432  /* "csmoothers.pyx":229
5433  * dX : np.array double
5434  * """
5435  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
5436  * R,
5437  * node_order,
5438  */
5439  __pyx_t_7 = __pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
5440  __Pyx_GOTREF(__pyx_t_7);
5441  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5442  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5443  __pyx_t_2.memview = NULL;
5444  __pyx_t_2.data = NULL;
5445  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5446  __pyx_t_3.memview = NULL;
5447  __pyx_t_3.data = NULL;
5448  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5449  __pyx_t_6.memview = NULL;
5450  __pyx_t_6.data = NULL;
5451  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5452 
5453  /* "csmoothers.pyx":217
5454  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5455  *
5456  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
5457  * """
5458  *
5459  */
5460 
5461  /* function exit code */
5462  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5463  goto __pyx_L0;
5464  __pyx_L1_error:;
5465  __Pyx_XDECREF(__pyx_t_1);
5466  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5467  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5468  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5469  __Pyx_XDECREF(__pyx_t_7);
5470  __Pyx_AddTraceback("csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5471  __pyx_r = NULL;
5472  __pyx_L0:;
5473  __Pyx_XGIVEREF(__pyx_r);
5474  __Pyx_RefNannyFinishContext();
5475  return __pyx_r;
5476 }
5477 
5478 /* "csmoothers.pyx":236
5479  * dX)
5480  *
5481  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5482  * DDATA R,
5483  * IDATA node_order,
5484  */
5485 
5486 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5487  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5488  PyObject *__pyx_r = NULL;
5489  __Pyx_RefNannyDeclarations
5490  PyObject *__pyx_t_1 = NULL;
5491  int __pyx_t_2;
5492  Py_ssize_t __pyx_t_3;
5493  Py_ssize_t __pyx_t_4;
5494  Py_ssize_t __pyx_t_5;
5495  __Pyx_RefNannySetupContext("smootherWrappers_nl_gauss_seidel_NR_solve", 0);
5496 
5497  /* "csmoothers.pyx":243
5498  * DDATA dX):
5499  * cdef SuperMatrix AS
5500  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5501  * AS.Dtype = superluWrappers._SLU_D
5502  * AS.Mtype = superluWrappers._SLU_GE
5503  */
5504  __pyx_v_AS.Stype = SLU_NR;
5505 
5506  /* "csmoothers.pyx":244
5507  * cdef SuperMatrix AS
5508  * AS.Stype = superluWrappers._SLU_NR
5509  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5510  * AS.Mtype = superluWrappers._SLU_GE
5511  * AS.nrow = sm.nr
5512  */
5513  __pyx_v_AS.Dtype = SLU_D;
5514 
5515  /* "csmoothers.pyx":245
5516  * AS.Stype = superluWrappers._SLU_NR
5517  * AS.Dtype = superluWrappers._SLU_D
5518  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5519  * AS.nrow = sm.nr
5520  * AS.ncol = sm.nc
5521  */
5522  __pyx_v_AS.Mtype = SLU_GE;
5523 
5524  /* "csmoothers.pyx":246
5525  * AS.Dtype = superluWrappers._SLU_D
5526  * AS.Mtype = superluWrappers._SLU_GE
5527  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5528  * AS.ncol = sm.nc
5529  * AS.Store = &sm.A
5530  */
5531  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
5532  __Pyx_GOTREF(__pyx_t_1);
5533  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
5534  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5535  __pyx_v_AS.nrow = __pyx_t_2;
5536 
5537  /* "csmoothers.pyx":247
5538  * AS.Mtype = superluWrappers._SLU_GE
5539  * AS.nrow = sm.nr
5540  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5541  * AS.Store = &sm.A
5542  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5543  */
5544  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
5545  __Pyx_GOTREF(__pyx_t_1);
5546  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
5547  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5548  __pyx_v_AS.ncol = __pyx_t_2;
5549 
5550  /* "csmoothers.pyx":248
5551  * AS.nrow = sm.nr
5552  * AS.ncol = sm.nc
5553  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5554  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5555  *
5556  */
5557  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5558 
5559  /* "csmoothers.pyx":249
5560  * AS.ncol = sm.nc
5561  * AS.Store = &sm.A
5562  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0]) # <<<<<<<<<<<<<<
5563  *
5564  * def asm_NR_prepare(A, asmFactor):
5565  */
5566  __pyx_t_3 = 0;
5567  __pyx_t_2 = -1;
5568  if (__pyx_t_3 < 0) {
5569  __pyx_t_3 += __pyx_v_R.shape[0];
5570  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5571  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5572  if (unlikely(__pyx_t_2 != -1)) {
5573  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5574  __PYX_ERR(0, 249, __pyx_L1_error)
5575  }
5576  __pyx_t_4 = 0;
5577  __pyx_t_2 = -1;
5578  if (__pyx_t_4 < 0) {
5579  __pyx_t_4 += __pyx_v_node_order.shape[0];
5580  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5581  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5582  if (unlikely(__pyx_t_2 != -1)) {
5583  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5584  __PYX_ERR(0, 249, __pyx_L1_error)
5585  }
5586  __pyx_t_5 = 0;
5587  __pyx_t_2 = -1;
5588  if (__pyx_t_5 < 0) {
5589  __pyx_t_5 += __pyx_v_dX.shape[0];
5590  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5591  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5592  if (unlikely(__pyx_t_2 != -1)) {
5593  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5594  __PYX_ERR(0, 249, __pyx_L1_error)
5595  }
5596  nl_gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
5597 
5598  /* "csmoothers.pyx":236
5599  * dX)
5600  *
5601  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5602  * DDATA R,
5603  * IDATA node_order,
5604  */
5605 
5606  /* function exit code */
5607  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5608  goto __pyx_L0;
5609  __pyx_L1_error:;
5610  __Pyx_XDECREF(__pyx_t_1);
5611  __Pyx_AddTraceback("csmoothers.smootherWrappers_nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5612  __pyx_r = 0;
5613  __pyx_L0:;
5614  __Pyx_XGIVEREF(__pyx_r);
5615  __Pyx_RefNannyFinishContext();
5616  return __pyx_r;
5617 }
5618 
5619 /* "csmoothers.pyx":251
5620  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5621  *
5622  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
5623  * """
5624  *
5625  */
5626 
5627 /* Python wrapper */
5628 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5629 static char __pyx_doc_10csmoothers_12asm_NR_prepare[] = "\n\n Arguments\n ---------\n A :\n asmFactor :\n ";
5630 static PyMethodDef __pyx_mdef_10csmoothers_13asm_NR_prepare = {"asm_NR_prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_13asm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_12asm_NR_prepare};
5631 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5632  PyObject *__pyx_v_A = 0;
5633  PyObject *__pyx_v_asmFactor = 0;
5634  PyObject *__pyx_r = 0;
5635  __Pyx_RefNannyDeclarations
5636  __Pyx_RefNannySetupContext("asm_NR_prepare (wrapper)", 0);
5637  {
5638  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_asmFactor,0};
5639  PyObject* values[2] = {0,0};
5640  if (unlikely(__pyx_kwds)) {
5641  Py_ssize_t kw_args;
5642  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5643  switch (pos_args) {
5644  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5645  CYTHON_FALLTHROUGH;
5646  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5647  CYTHON_FALLTHROUGH;
5648  case 0: break;
5649  default: goto __pyx_L5_argtuple_error;
5650  }
5651  kw_args = PyDict_Size(__pyx_kwds);
5652  switch (pos_args) {
5653  case 0:
5654  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5655  else goto __pyx_L5_argtuple_error;
5656  CYTHON_FALLTHROUGH;
5657  case 1:
5658  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
5659  else {
5660  __Pyx_RaiseArgtupleInvalid("asm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 251, __pyx_L3_error)
5661  }
5662  }
5663  if (unlikely(kw_args > 0)) {
5664  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asm_NR_prepare") < 0)) __PYX_ERR(0, 251, __pyx_L3_error)
5665  }
5666  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5667  goto __pyx_L5_argtuple_error;
5668  } else {
5669  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5670  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5671  }
5672  __pyx_v_A = values[0];
5673  __pyx_v_asmFactor = values[1];
5674  }
5675  goto __pyx_L4_argument_unpacking_done;
5676  __pyx_L5_argtuple_error:;
5677  __Pyx_RaiseArgtupleInvalid("asm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 251, __pyx_L3_error)
5678  __pyx_L3_error:;
5679  __Pyx_AddTraceback("csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5680  __Pyx_RefNannyFinishContext();
5681  return NULL;
5682  __pyx_L4_argument_unpacking_done:;
5683  __pyx_r = __pyx_pf_10csmoothers_12asm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_asmFactor);
5684 
5685  /* function exit code */
5686  __Pyx_RefNannyFinishContext();
5687  return __pyx_r;
5688 }
5689 
5690 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor) {
5691  PyObject *__pyx_r = NULL;
5692  __Pyx_RefNannyDeclarations
5693  PyObject *__pyx_t_1 = NULL;
5694  PyObject *__pyx_t_2 = NULL;
5695  __Pyx_RefNannySetupContext("asm_NR_prepare", 0);
5696 
5697  /* "csmoothers.pyx":259
5698  * asmFactor :
5699  * """
5700  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
5701  * asmFactor._cASMFactor)
5702  *
5703  */
5704  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
5705  __Pyx_GOTREF(__pyx_t_1);
5706  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 259, __pyx_L1_error)
5707 
5708  /* "csmoothers.pyx":260
5709  * """
5710  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix,
5711  * asmFactor._cASMFactor) # <<<<<<<<<<<<<<
5712  *
5713  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm,
5714  */
5715  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
5716  __Pyx_GOTREF(__pyx_t_2);
5717  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 260, __pyx_L1_error)
5718 
5719  /* "csmoothers.pyx":259
5720  * asmFactor :
5721  * """
5722  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
5723  * asmFactor._cASMFactor)
5724  *
5725  */
5726  __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_2));
5727  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5728  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5729 
5730  /* "csmoothers.pyx":251
5731  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5732  *
5733  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
5734  * """
5735  *
5736  */
5737 
5738  /* function exit code */
5739  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5740  goto __pyx_L0;
5741  __pyx_L1_error:;
5742  __Pyx_XDECREF(__pyx_t_1);
5743  __Pyx_XDECREF(__pyx_t_2);
5744  __Pyx_AddTraceback("csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5745  __pyx_r = NULL;
5746  __pyx_L0:;
5747  __Pyx_XGIVEREF(__pyx_r);
5748  __Pyx_RefNannyFinishContext();
5749  return __pyx_r;
5750 }
5751 
5752 /* "csmoothers.pyx":262
5753  * asmFactor._cASMFactor)
5754  *
5755  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5756  * cASMFactor asmFactor):
5757  * cdef SuperMatrix AS
5758  */
5759 
5760 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor) {
5761  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5762  __Pyx_RefNannyDeclarations
5763  PyObject *__pyx_t_1 = NULL;
5764  int __pyx_t_2;
5765  __Pyx_RefNannySetupContext("smootherWrappers_asm_NR_prepare", 0);
5766 
5767  /* "csmoothers.pyx":265
5768  * cASMFactor asmFactor):
5769  * cdef SuperMatrix AS
5770  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5771  * AS.Dtype = superluWrappers._SLU_D
5772  * AS.Mtype = superluWrappers._SLU_GE
5773  */
5774  __pyx_v_AS.Stype = SLU_NR;
5775 
5776  /* "csmoothers.pyx":266
5777  * cdef SuperMatrix AS
5778  * AS.Stype = superluWrappers._SLU_NR
5779  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5780  * AS.Mtype = superluWrappers._SLU_GE
5781  * AS.nrow = sm.nr
5782  */
5783  __pyx_v_AS.Dtype = SLU_D;
5784 
5785  /* "csmoothers.pyx":267
5786  * AS.Stype = superluWrappers._SLU_NR
5787  * AS.Dtype = superluWrappers._SLU_D
5788  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5789  * AS.nrow = sm.nr
5790  * AS.ncol = sm.nc
5791  */
5792  __pyx_v_AS.Mtype = SLU_GE;
5793 
5794  /* "csmoothers.pyx":268
5795  * AS.Dtype = superluWrappers._SLU_D
5796  * AS.Mtype = superluWrappers._SLU_GE
5797  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5798  * AS.ncol = sm.nc
5799  * AS.Store = &sm.A
5800  */
5801  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
5802  __Pyx_GOTREF(__pyx_t_1);
5803  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
5804  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5805  __pyx_v_AS.nrow = __pyx_t_2;
5806 
5807  /* "csmoothers.pyx":269
5808  * AS.Mtype = superluWrappers._SLU_GE
5809  * AS.nrow = sm.nr
5810  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5811  * AS.Store = &sm.A
5812  * casm_NR_prepare(&AS,
5813  */
5814  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
5815  __Pyx_GOTREF(__pyx_t_1);
5816  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5817  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5818  __pyx_v_AS.ncol = __pyx_t_2;
5819 
5820  /* "csmoothers.pyx":270
5821  * AS.nrow = sm.nr
5822  * AS.ncol = sm.nc
5823  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5824  * casm_NR_prepare(&AS,
5825  * asmFactor.subdomain_dim,
5826  */
5827  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5828 
5829  /* "csmoothers.pyx":271
5830  * AS.ncol = sm.nc
5831  * AS.Store = &sm.A
5832  * casm_NR_prepare(&AS, # <<<<<<<<<<<<<<
5833  * asmFactor.subdomain_dim,
5834  * asmFactor.l2g_L,
5835  */
5836  asm_NR_prepare((&__pyx_v_AS), __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_pivots);
5837 
5838  /* "csmoothers.pyx":262
5839  * asmFactor._cASMFactor)
5840  *
5841  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5842  * cASMFactor asmFactor):
5843  * cdef SuperMatrix AS
5844  */
5845 
5846  /* function exit code */
5847  goto __pyx_L0;
5848  __pyx_L1_error:;
5849  __Pyx_XDECREF(__pyx_t_1);
5850  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5851  __pyx_L0:;
5852  __Pyx_RefNannyFinishContext();
5853 }
5854 
5855 /* "csmoothers.pyx":277
5856  * asmFactor.subdomain_pivots)
5857  *
5858  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
5859  * """
5860  *
5861  */
5862 
5863 /* Python wrapper */
5864 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5865 static char __pyx_doc_10csmoothers_14asm_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.sparseMatrix\n w : double\n asmFactor : csmoothers.asmFactor\n node_order : np.array int\n R : np.array double\n dX : np.array double\n ";
5866 static PyMethodDef __pyx_mdef_10csmoothers_15asm_NR_solve = {"asm_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_15asm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_14asm_NR_solve};
5867 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5868  PyObject *__pyx_v_A = 0;
5869  PyObject *__pyx_v_w = 0;
5870  PyObject *__pyx_v_asmFactor = 0;
5871  PyObject *__pyx_v_node_order = 0;
5872  PyObject *__pyx_v_R = 0;
5873  PyObject *__pyx_v_dX = 0;
5874  PyObject *__pyx_r = 0;
5875  __Pyx_RefNannyDeclarations
5876  __Pyx_RefNannySetupContext("asm_NR_solve (wrapper)", 0);
5877  {
5878  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_asmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
5879  PyObject* values[6] = {0,0,0,0,0,0};
5880  if (unlikely(__pyx_kwds)) {
5881  Py_ssize_t kw_args;
5882  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5883  switch (pos_args) {
5884  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5885  CYTHON_FALLTHROUGH;
5886  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5887  CYTHON_FALLTHROUGH;
5888  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5889  CYTHON_FALLTHROUGH;
5890  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5891  CYTHON_FALLTHROUGH;
5892  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5893  CYTHON_FALLTHROUGH;
5894  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5895  CYTHON_FALLTHROUGH;
5896  case 0: break;
5897  default: goto __pyx_L5_argtuple_error;
5898  }
5899  kw_args = PyDict_Size(__pyx_kwds);
5900  switch (pos_args) {
5901  case 0:
5902  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5903  else goto __pyx_L5_argtuple_error;
5904  CYTHON_FALLTHROUGH;
5905  case 1:
5906  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
5907  else {
5908  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 277, __pyx_L3_error)
5909  }
5910  CYTHON_FALLTHROUGH;
5911  case 2:
5912  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
5913  else {
5914  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 277, __pyx_L3_error)
5915  }
5916  CYTHON_FALLTHROUGH;
5917  case 3:
5918  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5919  else {
5920  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 277, __pyx_L3_error)
5921  }
5922  CYTHON_FALLTHROUGH;
5923  case 4:
5924  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5925  else {
5926  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 277, __pyx_L3_error)
5927  }
5928  CYTHON_FALLTHROUGH;
5929  case 5:
5930  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5931  else {
5932  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 277, __pyx_L3_error)
5933  }
5934  }
5935  if (unlikely(kw_args > 0)) {
5936  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asm_NR_solve") < 0)) __PYX_ERR(0, 277, __pyx_L3_error)
5937  }
5938  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5939  goto __pyx_L5_argtuple_error;
5940  } else {
5941  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5942  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5943  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5944  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5945  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5946  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5947  }
5948  __pyx_v_A = values[0];
5949  __pyx_v_w = values[1];
5950  __pyx_v_asmFactor = values[2];
5951  __pyx_v_node_order = values[3];
5952  __pyx_v_R = values[4];
5953  __pyx_v_dX = values[5];
5954  }
5955  goto __pyx_L4_argument_unpacking_done;
5956  __pyx_L5_argtuple_error:;
5957  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error)
5958  __pyx_L3_error:;
5959  __Pyx_AddTraceback("csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5960  __Pyx_RefNannyFinishContext();
5961  return NULL;
5962  __pyx_L4_argument_unpacking_done:;
5963  __pyx_r = __pyx_pf_10csmoothers_14asm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_asmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
5964 
5965  /* function exit code */
5966  __Pyx_RefNannyFinishContext();
5967  return __pyx_r;
5968 }
5969 
5970 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
5971  PyObject *__pyx_r = NULL;
5972  __Pyx_RefNannyDeclarations
5973  PyObject *__pyx_t_1 = NULL;
5974  double __pyx_t_2;
5975  PyObject *__pyx_t_3 = NULL;
5976  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
5977  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
5978  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5979  __Pyx_RefNannySetupContext("asm_NR_solve", 0);
5980 
5981  /* "csmoothers.pyx":289
5982  * dX : np.array double
5983  * """
5984  * smootherWrappers_asm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
5985  * w,
5986  * asmFactor._cASMFactor,
5987  */
5988  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
5989  __Pyx_GOTREF(__pyx_t_1);
5990  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 289, __pyx_L1_error)
5991 
5992  /* "csmoothers.pyx":290
5993  * """
5994  * smootherWrappers_asm_NR_solve(A._cSparseMatrix,
5995  * w, # <<<<<<<<<<<<<<
5996  * asmFactor._cASMFactor,
5997  * node_order,
5998  */
5999  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
6000 
6001  /* "csmoothers.pyx":291
6002  * smootherWrappers_asm_NR_solve(A._cSparseMatrix,
6003  * w,
6004  * asmFactor._cASMFactor, # <<<<<<<<<<<<<<
6005  * node_order,
6006  * R,
6007  */
6008  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
6009  __Pyx_GOTREF(__pyx_t_3);
6010  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 291, __pyx_L1_error)
6011 
6012  /* "csmoothers.pyx":292
6013  * w,
6014  * asmFactor._cASMFactor,
6015  * node_order, # <<<<<<<<<<<<<<
6016  * R,
6017  * dX)
6018  */
6019  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 292, __pyx_L1_error)
6020 
6021  /* "csmoothers.pyx":293
6022  * asmFactor._cASMFactor,
6023  * node_order,
6024  * R, # <<<<<<<<<<<<<<
6025  * dX)
6026  *
6027  */
6028  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 293, __pyx_L1_error)
6029 
6030  /* "csmoothers.pyx":294
6031  * node_order,
6032  * R,
6033  * dX) # <<<<<<<<<<<<<<
6034  *
6035  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm,
6036  */
6037  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 294, __pyx_L1_error)
6038 
6039  /* "csmoothers.pyx":289
6040  * dX : np.array double
6041  * """
6042  * smootherWrappers_asm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6043  * w,
6044  * asmFactor._cASMFactor,
6045  */
6046  __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6047  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6048  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6049  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6050  __pyx_t_4.memview = NULL;
6051  __pyx_t_4.data = NULL;
6052  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6053  __pyx_t_5.memview = NULL;
6054  __pyx_t_5.data = NULL;
6055  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6056  __pyx_t_6.memview = NULL;
6057  __pyx_t_6.data = NULL;
6058 
6059  /* "csmoothers.pyx":277
6060  * asmFactor.subdomain_pivots)
6061  *
6062  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6063  * """
6064  *
6065  */
6066 
6067  /* function exit code */
6068  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6069  goto __pyx_L0;
6070  __pyx_L1_error:;
6071  __Pyx_XDECREF(__pyx_t_1);
6072  __Pyx_XDECREF(__pyx_t_3);
6073  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6074  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6075  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6076  __Pyx_AddTraceback("csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6077  __pyx_r = NULL;
6078  __pyx_L0:;
6079  __Pyx_XGIVEREF(__pyx_r);
6080  __Pyx_RefNannyFinishContext();
6081  return __pyx_r;
6082 }
6083 
6084 /* "csmoothers.pyx":296
6085  * dX)
6086  *
6087  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6088  * double w,
6089  * cASMFactor asmFactor,
6090  */
6091 
6092 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6093  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6094  __Pyx_RefNannyDeclarations
6095  PyObject *__pyx_t_1 = NULL;
6096  int __pyx_t_2;
6097  Py_ssize_t __pyx_t_3;
6098  Py_ssize_t __pyx_t_4;
6099  Py_ssize_t __pyx_t_5;
6100  __Pyx_RefNannySetupContext("smootherWrappers_asm_NR_solve", 0);
6101 
6102  /* "csmoothers.pyx":303
6103  * DDATA dX):
6104  * cdef SuperMatrix AS
6105  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
6106  * AS.Dtype = superluWrappers._SLU_D
6107  * AS.Mtype = superluWrappers._SLU_GE
6108  */
6109  __pyx_v_AS.Stype = SLU_NR;
6110 
6111  /* "csmoothers.pyx":304
6112  * cdef SuperMatrix AS
6113  * AS.Stype = superluWrappers._SLU_NR
6114  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6115  * AS.Mtype = superluWrappers._SLU_GE
6116  * AS.nrow = sm.nr
6117  */
6118  __pyx_v_AS.Dtype = SLU_D;
6119 
6120  /* "csmoothers.pyx":305
6121  * AS.Stype = superluWrappers._SLU_NR
6122  * AS.Dtype = superluWrappers._SLU_D
6123  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6124  * AS.nrow = sm.nr
6125  * AS.ncol = sm.nc
6126  */
6127  __pyx_v_AS.Mtype = SLU_GE;
6128 
6129  /* "csmoothers.pyx":306
6130  * AS.Dtype = superluWrappers._SLU_D
6131  * AS.Mtype = superluWrappers._SLU_GE
6132  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6133  * AS.ncol = sm.nc
6134  * AS.Store = &sm.A
6135  */
6136  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
6137  __Pyx_GOTREF(__pyx_t_1);
6138  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error)
6139  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6140  __pyx_v_AS.nrow = __pyx_t_2;
6141 
6142  /* "csmoothers.pyx":307
6143  * AS.Mtype = superluWrappers._SLU_GE
6144  * AS.nrow = sm.nr
6145  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6146  * AS.Store = &sm.A
6147  * casm_NR_solve(&AS,
6148  */
6149  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
6150  __Pyx_GOTREF(__pyx_t_1);
6151  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
6152  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6153  __pyx_v_AS.ncol = __pyx_t_2;
6154 
6155  /* "csmoothers.pyx":308
6156  * AS.nrow = sm.nr
6157  * AS.ncol = sm.nc
6158  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6159  * casm_NR_solve(&AS,
6160  * w,
6161  */
6162  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6163 
6164  /* "csmoothers.pyx":314
6165  * asmFactor.subdomain_dim,
6166  * asmFactor.l2g_L,
6167  * &R[0], # <<<<<<<<<<<<<<
6168  * asmFactor.subdomain_R,
6169  * &node_order[0],
6170  */
6171  __pyx_t_3 = 0;
6172  __pyx_t_2 = -1;
6173  if (__pyx_t_3 < 0) {
6174  __pyx_t_3 += __pyx_v_R.shape[0];
6175  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6176  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6177  if (unlikely(__pyx_t_2 != -1)) {
6178  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6179  __PYX_ERR(0, 314, __pyx_L1_error)
6180  }
6181 
6182  /* "csmoothers.pyx":316
6183  * &R[0],
6184  * asmFactor.subdomain_R,
6185  * &node_order[0], # <<<<<<<<<<<<<<
6186  * asmFactor.subdomain_dX,
6187  * &dX[0],
6188  */
6189  __pyx_t_4 = 0;
6190  __pyx_t_2 = -1;
6191  if (__pyx_t_4 < 0) {
6192  __pyx_t_4 += __pyx_v_node_order.shape[0];
6193  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6194  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6195  if (unlikely(__pyx_t_2 != -1)) {
6196  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6197  __PYX_ERR(0, 316, __pyx_L1_error)
6198  }
6199 
6200  /* "csmoothers.pyx":318
6201  * &node_order[0],
6202  * asmFactor.subdomain_dX,
6203  * &dX[0], # <<<<<<<<<<<<<<
6204  * asmFactor.subdomain_pivots)
6205  *
6206  */
6207  __pyx_t_5 = 0;
6208  __pyx_t_2 = -1;
6209  if (__pyx_t_5 < 0) {
6210  __pyx_t_5 += __pyx_v_dX.shape[0];
6211  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6212  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6213  if (unlikely(__pyx_t_2 != -1)) {
6214  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6215  __PYX_ERR(0, 318, __pyx_L1_error)
6216  }
6217 
6218  /* "csmoothers.pyx":309
6219  * AS.ncol = sm.nc
6220  * AS.Store = &sm.A
6221  * casm_NR_solve(&AS, # <<<<<<<<<<<<<<
6222  * w,
6223  * asmFactor.subdomain_L,
6224  */
6225  asm_NR_solve((&__pyx_v_AS), __pyx_v_w, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_asmFactor->subdomain_R, (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_asmFactor->subdomain_dX, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_asmFactor->subdomain_pivots);
6226 
6227  /* "csmoothers.pyx":296
6228  * dX)
6229  *
6230  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6231  * double w,
6232  * cASMFactor asmFactor,
6233  */
6234 
6235  /* function exit code */
6236  goto __pyx_L0;
6237  __pyx_L1_error:;
6238  __Pyx_XDECREF(__pyx_t_1);
6239  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6240  __pyx_L0:;
6241  __Pyx_RefNannyFinishContext();
6242 }
6243 
6244 /* "csmoothers.pyx":321
6245  * asmFactor.subdomain_pivots)
6246  *
6247  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
6248  * """
6249  *
6250  */
6251 
6252 /* Python wrapper */
6253 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6254 static char __pyx_doc_10csmoothers_16basm_NR_prepare[] = "\n\n Arguments\n ---------\n A :\n basmFactor :\n ";
6255 static PyMethodDef __pyx_mdef_10csmoothers_17basm_NR_prepare = {"basm_NR_prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_17basm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_16basm_NR_prepare};
6256 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6257  PyObject *__pyx_v_A = 0;
6258  PyObject *__pyx_v_basmFactor = 0;
6259  PyObject *__pyx_r = 0;
6260  __Pyx_RefNannyDeclarations
6261  __Pyx_RefNannySetupContext("basm_NR_prepare (wrapper)", 0);
6262  {
6263  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_basmFactor,0};
6264  PyObject* values[2] = {0,0};
6265  if (unlikely(__pyx_kwds)) {
6266  Py_ssize_t kw_args;
6267  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6268  switch (pos_args) {
6269  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6270  CYTHON_FALLTHROUGH;
6271  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6272  CYTHON_FALLTHROUGH;
6273  case 0: break;
6274  default: goto __pyx_L5_argtuple_error;
6275  }
6276  kw_args = PyDict_Size(__pyx_kwds);
6277  switch (pos_args) {
6278  case 0:
6279  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6280  else goto __pyx_L5_argtuple_error;
6281  CYTHON_FALLTHROUGH;
6282  case 1:
6283  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6284  else {
6285  __Pyx_RaiseArgtupleInvalid("basm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 321, __pyx_L3_error)
6286  }
6287  }
6288  if (unlikely(kw_args > 0)) {
6289  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "basm_NR_prepare") < 0)) __PYX_ERR(0, 321, __pyx_L3_error)
6290  }
6291  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6292  goto __pyx_L5_argtuple_error;
6293  } else {
6294  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6295  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6296  }
6297  __pyx_v_A = values[0];
6298  __pyx_v_basmFactor = values[1];
6299  }
6300  goto __pyx_L4_argument_unpacking_done;
6301  __pyx_L5_argtuple_error:;
6302  __Pyx_RaiseArgtupleInvalid("basm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 321, __pyx_L3_error)
6303  __pyx_L3_error:;
6304  __Pyx_AddTraceback("csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6305  __Pyx_RefNannyFinishContext();
6306  return NULL;
6307  __pyx_L4_argument_unpacking_done:;
6308  __pyx_r = __pyx_pf_10csmoothers_16basm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_basmFactor);
6309 
6310  /* function exit code */
6311  __Pyx_RefNannyFinishContext();
6312  return __pyx_r;
6313 }
6314 
6315 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor) {
6316  PyObject *__pyx_r = NULL;
6317  __Pyx_RefNannyDeclarations
6318  PyObject *__pyx_t_1 = NULL;
6319  PyObject *__pyx_t_2 = NULL;
6320  __Pyx_RefNannySetupContext("basm_NR_prepare", 0);
6321 
6322  /* "csmoothers.pyx":329
6323  * basmFactor :
6324  * """
6325  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
6326  * basmFactor._cBASMFactor)
6327  *
6328  */
6329  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
6330  __Pyx_GOTREF(__pyx_t_1);
6331  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 329, __pyx_L1_error)
6332 
6333  /* "csmoothers.pyx":330
6334  * """
6335  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix,
6336  * basmFactor._cBASMFactor) # <<<<<<<<<<<<<<
6337  *
6338  * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm,
6339  */
6340  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
6341  __Pyx_GOTREF(__pyx_t_2);
6342  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 330, __pyx_L1_error)
6343 
6344  /* "csmoothers.pyx":329
6345  * basmFactor :
6346  * """
6347  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
6348  * basmFactor._cBASMFactor)
6349  *
6350  */
6351  __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_2));
6352  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6353  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6354 
6355  /* "csmoothers.pyx":321
6356  * asmFactor.subdomain_pivots)
6357  *
6358  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
6359  * """
6360  *
6361  */
6362 
6363  /* function exit code */
6364  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6365  goto __pyx_L0;
6366  __pyx_L1_error:;
6367  __Pyx_XDECREF(__pyx_t_1);
6368  __Pyx_XDECREF(__pyx_t_2);
6369  __Pyx_AddTraceback("csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6370  __pyx_r = NULL;
6371  __pyx_L0:;
6372  __Pyx_XGIVEREF(__pyx_r);
6373  __Pyx_RefNannyFinishContext();
6374  return __pyx_r;
6375 }
6376 
6377 /* "csmoothers.pyx":332
6378  * basmFactor._cBASMFactor)
6379  *
6380  * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6381  * cBASMFactor basmFactor):
6382  * cdef SuperMatrix AS
6383  */
6384 
6385 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor) {
6386  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6387  __Pyx_RefNannyDeclarations
6388  PyObject *__pyx_t_1 = NULL;
6389  int __pyx_t_2;
6390  __Pyx_RefNannySetupContext("smootherWrappers_basm_NR_prepare", 0);
6391 
6392  /* "csmoothers.pyx":335
6393  * cBASMFactor basmFactor):
6394  * cdef SuperMatrix AS
6395  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6396  * AS.Mtype = superluWrappers._SLU_GE
6397  * AS.nrow = sm.nr
6398  */
6399  __pyx_v_AS.Dtype = SLU_D;
6400 
6401  /* "csmoothers.pyx":336
6402  * cdef SuperMatrix AS
6403  * AS.Dtype = superluWrappers._SLU_D
6404  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6405  * AS.nrow = sm.nr
6406  * AS.ncol = sm.nc
6407  */
6408  __pyx_v_AS.Mtype = SLU_GE;
6409 
6410  /* "csmoothers.pyx":337
6411  * AS.Dtype = superluWrappers._SLU_D
6412  * AS.Mtype = superluWrappers._SLU_GE
6413  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6414  * AS.ncol = sm.nc
6415  * AS.Store = &sm.A
6416  */
6417  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
6418  __Pyx_GOTREF(__pyx_t_1);
6419  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
6420  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6421  __pyx_v_AS.nrow = __pyx_t_2;
6422 
6423  /* "csmoothers.pyx":338
6424  * AS.Mtype = superluWrappers._SLU_GE
6425  * AS.nrow = sm.nr
6426  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6427  * AS.Store = &sm.A
6428  * cbasm_NR_prepare(basmFactor.bs,
6429  */
6430  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
6431  __Pyx_GOTREF(__pyx_t_1);
6432  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
6433  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6434  __pyx_v_AS.ncol = __pyx_t_2;
6435 
6436  /* "csmoothers.pyx":339
6437  * AS.nrow = sm.nr
6438  * AS.ncol = sm.nc
6439  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6440  * cbasm_NR_prepare(basmFactor.bs,
6441  * basmFactor.N,
6442  */
6443  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6444 
6445  /* "csmoothers.pyx":340
6446  * AS.ncol = sm.nc
6447  * AS.Store = &sm.A
6448  * cbasm_NR_prepare(basmFactor.bs, # <<<<<<<<<<<<<<
6449  * basmFactor.N,
6450  * &AS,
6451  */
6452  basm_NR_prepare(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6453 
6454  /* "csmoothers.pyx":332
6455  * basmFactor._cBASMFactor)
6456  *
6457  * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6458  * cBASMFactor basmFactor):
6459  * cdef SuperMatrix AS
6460  */
6461 
6462  /* function exit code */
6463  goto __pyx_L0;
6464  __pyx_L1_error:;
6465  __Pyx_XDECREF(__pyx_t_1);
6466  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6467  __pyx_L0:;
6468  __Pyx_RefNannyFinishContext();
6469 }
6470 
6471 /* "csmoothers.pyx":350
6472  *
6473  *
6474  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6475  * """
6476  *
6477  */
6478 
6479 /* Python wrapper */
6480 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6481 static char __pyx_doc_10csmoothers_18basm_NR_solve[] = "\n \n Arguments\n ---------\n A :\n w :\n basmFactor :\n node_order :\n R :\n dX :\n ";
6482 static PyMethodDef __pyx_mdef_10csmoothers_19basm_NR_solve = {"basm_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_19basm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_18basm_NR_solve};
6483 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6484  PyObject *__pyx_v_A = 0;
6485  PyObject *__pyx_v_w = 0;
6486  PyObject *__pyx_v_basmFactor = 0;
6487  PyObject *__pyx_v_node_order = 0;
6488  PyObject *__pyx_v_R = 0;
6489  PyObject *__pyx_v_dX = 0;
6490  PyObject *__pyx_r = 0;
6491  __Pyx_RefNannyDeclarations
6492  __Pyx_RefNannySetupContext("basm_NR_solve (wrapper)", 0);
6493  {
6494  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_basmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
6495  PyObject* values[6] = {0,0,0,0,0,0};
6496  if (unlikely(__pyx_kwds)) {
6497  Py_ssize_t kw_args;
6498  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6499  switch (pos_args) {
6500  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6501  CYTHON_FALLTHROUGH;
6502  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6503  CYTHON_FALLTHROUGH;
6504  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6505  CYTHON_FALLTHROUGH;
6506  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6507  CYTHON_FALLTHROUGH;
6508  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6509  CYTHON_FALLTHROUGH;
6510  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6511  CYTHON_FALLTHROUGH;
6512  case 0: break;
6513  default: goto __pyx_L5_argtuple_error;
6514  }
6515  kw_args = PyDict_Size(__pyx_kwds);
6516  switch (pos_args) {
6517  case 0:
6518  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6519  else goto __pyx_L5_argtuple_error;
6520  CYTHON_FALLTHROUGH;
6521  case 1:
6522  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6523  else {
6524  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 350, __pyx_L3_error)
6525  }
6526  CYTHON_FALLTHROUGH;
6527  case 2:
6528  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6529  else {
6530  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 350, __pyx_L3_error)
6531  }
6532  CYTHON_FALLTHROUGH;
6533  case 3:
6534  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6535  else {
6536  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 350, __pyx_L3_error)
6537  }
6538  CYTHON_FALLTHROUGH;
6539  case 4:
6540  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6541  else {
6542  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 350, __pyx_L3_error)
6543  }
6544  CYTHON_FALLTHROUGH;
6545  case 5:
6546  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6547  else {
6548  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 350, __pyx_L3_error)
6549  }
6550  }
6551  if (unlikely(kw_args > 0)) {
6552  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "basm_NR_solve") < 0)) __PYX_ERR(0, 350, __pyx_L3_error)
6553  }
6554  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6555  goto __pyx_L5_argtuple_error;
6556  } else {
6557  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6558  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6559  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6560  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6561  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6562  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6563  }
6564  __pyx_v_A = values[0];
6565  __pyx_v_w = values[1];
6566  __pyx_v_basmFactor = values[2];
6567  __pyx_v_node_order = values[3];
6568  __pyx_v_R = values[4];
6569  __pyx_v_dX = values[5];
6570  }
6571  goto __pyx_L4_argument_unpacking_done;
6572  __pyx_L5_argtuple_error:;
6573  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 350, __pyx_L3_error)
6574  __pyx_L3_error:;
6575  __Pyx_AddTraceback("csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6576  __Pyx_RefNannyFinishContext();
6577  return NULL;
6578  __pyx_L4_argument_unpacking_done:;
6579  __pyx_r = __pyx_pf_10csmoothers_18basm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_basmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6580 
6581  /* function exit code */
6582  __Pyx_RefNannyFinishContext();
6583  return __pyx_r;
6584 }
6585 
6586 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6587  PyObject *__pyx_r = NULL;
6588  __Pyx_RefNannyDeclarations
6589  PyObject *__pyx_t_1 = NULL;
6590  double __pyx_t_2;
6591  PyObject *__pyx_t_3 = NULL;
6592  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6593  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6594  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6595  __Pyx_RefNannySetupContext("basm_NR_solve", 0);
6596 
6597  /* "csmoothers.pyx":362
6598  * dX :
6599  * """
6600  * smootherWrappers_basm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6601  * w,
6602  * basmFactor._cBASMFactor,
6603  */
6604  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
6605  __Pyx_GOTREF(__pyx_t_1);
6606  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 362, __pyx_L1_error)
6607 
6608  /* "csmoothers.pyx":363
6609  * """
6610  * smootherWrappers_basm_NR_solve(A._cSparseMatrix,
6611  * w, # <<<<<<<<<<<<<<
6612  * basmFactor._cBASMFactor,
6613  * node_order,
6614  */
6615  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
6616 
6617  /* "csmoothers.pyx":364
6618  * smootherWrappers_basm_NR_solve(A._cSparseMatrix,
6619  * w,
6620  * basmFactor._cBASMFactor, # <<<<<<<<<<<<<<
6621  * node_order,
6622  * R,
6623  */
6624  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error)
6625  __Pyx_GOTREF(__pyx_t_3);
6626  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 364, __pyx_L1_error)
6627 
6628  /* "csmoothers.pyx":365
6629  * w,
6630  * basmFactor._cBASMFactor,
6631  * node_order, # <<<<<<<<<<<<<<
6632  * R,
6633  * dX)
6634  */
6635  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 365, __pyx_L1_error)
6636 
6637  /* "csmoothers.pyx":366
6638  * basmFactor._cBASMFactor,
6639  * node_order,
6640  * R, # <<<<<<<<<<<<<<
6641  * dX)
6642  *
6643  */
6644  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 366, __pyx_L1_error)
6645 
6646  /* "csmoothers.pyx":367
6647  * node_order,
6648  * R,
6649  * dX) # <<<<<<<<<<<<<<
6650  *
6651  * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm,
6652  */
6653  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 367, __pyx_L1_error)
6654 
6655  /* "csmoothers.pyx":362
6656  * dX :
6657  * """
6658  * smootherWrappers_basm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6659  * w,
6660  * basmFactor._cBASMFactor,
6661  */
6662  __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6663  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6664  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6665  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6666  __pyx_t_4.memview = NULL;
6667  __pyx_t_4.data = NULL;
6668  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6669  __pyx_t_5.memview = NULL;
6670  __pyx_t_5.data = NULL;
6671  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6672  __pyx_t_6.memview = NULL;
6673  __pyx_t_6.data = NULL;
6674 
6675  /* "csmoothers.pyx":350
6676  *
6677  *
6678  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6679  * """
6680  *
6681  */
6682 
6683  /* function exit code */
6684  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6685  goto __pyx_L0;
6686  __pyx_L1_error:;
6687  __Pyx_XDECREF(__pyx_t_1);
6688  __Pyx_XDECREF(__pyx_t_3);
6689  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6690  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6691  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6692  __Pyx_AddTraceback("csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6693  __pyx_r = NULL;
6694  __pyx_L0:;
6695  __Pyx_XGIVEREF(__pyx_r);
6696  __Pyx_RefNannyFinishContext();
6697  return __pyx_r;
6698 }
6699 
6700 /* "csmoothers.pyx":369
6701  * dX)
6702  *
6703  * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6704  * double w,
6705  * cBASMFactor basmFactor,
6706  */
6707 
6708 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6709  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6710  __Pyx_RefNannyDeclarations
6711  PyObject *__pyx_t_1 = NULL;
6712  int __pyx_t_2;
6713  Py_ssize_t __pyx_t_3;
6714  Py_ssize_t __pyx_t_4;
6715  Py_ssize_t __pyx_t_5;
6716  __Pyx_RefNannySetupContext("smootherWrappers_basm_NR_solve", 0);
6717 
6718  /* "csmoothers.pyx":376
6719  * DDATA dX):
6720  * cdef SuperMatrix AS
6721  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
6722  * AS.Dtype = superluWrappers._SLU_D
6723  * AS.Mtype = superluWrappers._SLU_GE
6724  */
6725  __pyx_v_AS.Stype = SLU_NR;
6726 
6727  /* "csmoothers.pyx":377
6728  * cdef SuperMatrix AS
6729  * AS.Stype = superluWrappers._SLU_NR
6730  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6731  * AS.Mtype = superluWrappers._SLU_GE
6732  * AS.nrow = sm.nr
6733  */
6734  __pyx_v_AS.Dtype = SLU_D;
6735 
6736  /* "csmoothers.pyx":378
6737  * AS.Stype = superluWrappers._SLU_NR
6738  * AS.Dtype = superluWrappers._SLU_D
6739  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6740  * AS.nrow = sm.nr
6741  * AS.ncol = sm.nc
6742  */
6743  __pyx_v_AS.Mtype = SLU_GE;
6744 
6745  /* "csmoothers.pyx":379
6746  * AS.Dtype = superluWrappers._SLU_D
6747  * AS.Mtype = superluWrappers._SLU_GE
6748  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6749  * AS.ncol = sm.nc
6750  * AS.Store = &sm.A
6751  */
6752  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
6753  __Pyx_GOTREF(__pyx_t_1);
6754  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error)
6755  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6756  __pyx_v_AS.nrow = __pyx_t_2;
6757 
6758  /* "csmoothers.pyx":380
6759  * AS.Mtype = superluWrappers._SLU_GE
6760  * AS.nrow = sm.nr
6761  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6762  * AS.Store = &sm.A
6763  * cbasm_NR_solve(basmFactor.bs,
6764  */
6765  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
6766  __Pyx_GOTREF(__pyx_t_1);
6767  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
6768  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6769  __pyx_v_AS.ncol = __pyx_t_2;
6770 
6771  /* "csmoothers.pyx":381
6772  * AS.nrow = sm.nr
6773  * AS.ncol = sm.nc
6774  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6775  * cbasm_NR_solve(basmFactor.bs,
6776  * basmFactor.N,
6777  */
6778  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6779 
6780  /* "csmoothers.pyx":389
6781  * basmFactor.subdomain_dim,
6782  * basmFactor.l2g_L,
6783  * &R[0], # <<<<<<<<<<<<<<
6784  * basmFactor.subdomain_R,
6785  * &node_order[0],
6786  */
6787  __pyx_t_3 = 0;
6788  __pyx_t_2 = -1;
6789  if (__pyx_t_3 < 0) {
6790  __pyx_t_3 += __pyx_v_R.shape[0];
6791  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6792  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6793  if (unlikely(__pyx_t_2 != -1)) {
6794  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6795  __PYX_ERR(0, 389, __pyx_L1_error)
6796  }
6797 
6798  /* "csmoothers.pyx":391
6799  * &R[0],
6800  * basmFactor.subdomain_R,
6801  * &node_order[0], # <<<<<<<<<<<<<<
6802  * basmFactor.subdomain_dX,
6803  * &dX[0],
6804  */
6805  __pyx_t_4 = 0;
6806  __pyx_t_2 = -1;
6807  if (__pyx_t_4 < 0) {
6808  __pyx_t_4 += __pyx_v_node_order.shape[0];
6809  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6810  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6811  if (unlikely(__pyx_t_2 != -1)) {
6812  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6813  __PYX_ERR(0, 391, __pyx_L1_error)
6814  }
6815 
6816  /* "csmoothers.pyx":393
6817  * &node_order[0],
6818  * basmFactor.subdomain_dX,
6819  * &dX[0], # <<<<<<<<<<<<<<
6820  * basmFactor.subdomain_pivots,
6821  * basmFactor.subdomain_col_pivots)
6822  */
6823  __pyx_t_5 = 0;
6824  __pyx_t_2 = -1;
6825  if (__pyx_t_5 < 0) {
6826  __pyx_t_5 += __pyx_v_dX.shape[0];
6827  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6828  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6829  if (unlikely(__pyx_t_2 != -1)) {
6830  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6831  __PYX_ERR(0, 393, __pyx_L1_error)
6832  }
6833 
6834  /* "csmoothers.pyx":382
6835  * AS.ncol = sm.nc
6836  * AS.Store = &sm.A
6837  * cbasm_NR_solve(basmFactor.bs, # <<<<<<<<<<<<<<
6838  * basmFactor.N,
6839  * &AS,
6840  */
6841  basm_NR_solve(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_w, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_basmFactor->subdomain_R, (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_basmFactor->subdomain_dX, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6842 
6843  /* "csmoothers.pyx":369
6844  * dX)
6845  *
6846  * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6847  * double w,
6848  * cBASMFactor basmFactor,
6849  */
6850 
6851  /* function exit code */
6852  goto __pyx_L0;
6853  __pyx_L1_error:;
6854  __Pyx_XDECREF(__pyx_t_1);
6855  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6856  __pyx_L0:;
6857  __Pyx_RefNannyFinishContext();
6858 }
6859 
6860 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
6861  * # experimental exception made for __getbuffer__ and __releasebuffer__
6862  * # -- the details of this may change.
6863  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
6864  * # This implementation of getbuffer is geared towards Cython
6865  * # requirements, and does not yet fulfill the PEP.
6866  */
6867 
6868 /* Python wrapper */
6869 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
6870 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6871  int __pyx_r;
6872  __Pyx_RefNannyDeclarations
6873  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
6874  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
6875 
6876  /* function exit code */
6877  __Pyx_RefNannyFinishContext();
6878  return __pyx_r;
6879 }
6880 
6881 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6882  int __pyx_v_i;
6883  int __pyx_v_ndim;
6884  int __pyx_v_endian_detector;
6885  int __pyx_v_little_endian;
6886  int __pyx_v_t;
6887  char *__pyx_v_f;
6888  PyArray_Descr *__pyx_v_descr = 0;
6889  int __pyx_v_offset;
6890  int __pyx_r;
6891  __Pyx_RefNannyDeclarations
6892  int __pyx_t_1;
6893  int __pyx_t_2;
6894  PyObject *__pyx_t_3 = NULL;
6895  int __pyx_t_4;
6896  int __pyx_t_5;
6897  int __pyx_t_6;
6898  PyArray_Descr *__pyx_t_7;
6899  PyObject *__pyx_t_8 = NULL;
6900  char *__pyx_t_9;
6901  if (__pyx_v_info == NULL) {
6902  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
6903  return -1;
6904  }
6905  __Pyx_RefNannySetupContext("__getbuffer__", 0);
6906  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6907  __Pyx_GIVEREF(__pyx_v_info->obj);
6908 
6909  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
6910  *
6911  * cdef int i, ndim
6912  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
6913  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6914  *
6915  */
6916  __pyx_v_endian_detector = 1;
6917 
6918  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
6919  * cdef int i, ndim
6920  * cdef int endian_detector = 1
6921  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
6922  *
6923  * ndim = PyArray_NDIM(self)
6924  */
6925  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
6926 
6927  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
6928  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6929  *
6930  * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
6931  *
6932  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6933  */
6934  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
6935 
6936  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6937  * ndim = PyArray_NDIM(self)
6938  *
6939  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6940  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6941  * raise ValueError(u"ndarray is not C contiguous")
6942  */
6943  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
6944  if (__pyx_t_2) {
6945  } else {
6946  __pyx_t_1 = __pyx_t_2;
6947  goto __pyx_L4_bool_binop_done;
6948  }
6949 
6950  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
6951  *
6952  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6953  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
6954  * raise ValueError(u"ndarray is not C contiguous")
6955  *
6956  */
6957  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
6958  __pyx_t_1 = __pyx_t_2;
6959  __pyx_L4_bool_binop_done:;
6960 
6961  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6962  * ndim = PyArray_NDIM(self)
6963  *
6964  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6965  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6966  * raise ValueError(u"ndarray is not C contiguous")
6967  */
6968  if (unlikely(__pyx_t_1)) {
6969 
6970  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
6971  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6972  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6973  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
6974  *
6975  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6976  */
6977  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 272, __pyx_L1_error)
6978  __Pyx_GOTREF(__pyx_t_3);
6979  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6980  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6981  __PYX_ERR(2, 272, __pyx_L1_error)
6982 
6983  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6984  * ndim = PyArray_NDIM(self)
6985  *
6986  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6987  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6988  * raise ValueError(u"ndarray is not C contiguous")
6989  */
6990  }
6991 
6992  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
6993  * raise ValueError(u"ndarray is not C contiguous")
6994  *
6995  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6996  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6997  * raise ValueError(u"ndarray is not Fortran contiguous")
6998  */
6999  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
7000  if (__pyx_t_2) {
7001  } else {
7002  __pyx_t_1 = __pyx_t_2;
7003  goto __pyx_L7_bool_binop_done;
7004  }
7005 
7006  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
7007  *
7008  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
7009  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
7010  * raise ValueError(u"ndarray is not Fortran contiguous")
7011  *
7012  */
7013  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
7014  __pyx_t_1 = __pyx_t_2;
7015  __pyx_L7_bool_binop_done:;
7016 
7017  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
7018  * raise ValueError(u"ndarray is not C contiguous")
7019  *
7020  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
7021  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
7022  * raise ValueError(u"ndarray is not Fortran contiguous")
7023  */
7024  if (unlikely(__pyx_t_1)) {
7025 
7026  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
7027  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
7028  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
7029  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
7030  *
7031  * info.buf = PyArray_DATA(self)
7032  */
7033  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 276, __pyx_L1_error)
7034  __Pyx_GOTREF(__pyx_t_3);
7035  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7036  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7037  __PYX_ERR(2, 276, __pyx_L1_error)
7038 
7039  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
7040  * raise ValueError(u"ndarray is not C contiguous")
7041  *
7042  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
7043  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
7044  * raise ValueError(u"ndarray is not Fortran contiguous")
7045  */
7046  }
7047 
7048  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
7049  * raise ValueError(u"ndarray is not Fortran contiguous")
7050  *
7051  * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
7052  * info.ndim = ndim
7053  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7054  */
7055  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
7056 
7057  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
7058  *
7059  * info.buf = PyArray_DATA(self)
7060  * info.ndim = ndim # <<<<<<<<<<<<<<
7061  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7062  * # Allocate new buffer for strides and shape info.
7063  */
7064  __pyx_v_info->ndim = __pyx_v_ndim;
7065 
7066  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
7067  * info.buf = PyArray_DATA(self)
7068  * info.ndim = ndim
7069  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
7070  * # Allocate new buffer for strides and shape info.
7071  * # This is allocated as one block, strides first.
7072  */
7073  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
7074  if (__pyx_t_1) {
7075 
7076  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
7077  * # Allocate new buffer for strides and shape info.
7078  * # This is allocated as one block, strides first.
7079  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
7080  * info.shape = info.strides + ndim
7081  * for i in range(ndim):
7082  */
7083  __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
7084 
7085  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
7086  * # This is allocated as one block, strides first.
7087  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
7088  * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
7089  * for i in range(ndim):
7090  * info.strides[i] = PyArray_STRIDES(self)[i]
7091  */
7092  __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
7093 
7094  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":285
7095  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
7096  * info.shape = info.strides + ndim
7097  * for i in range(ndim): # <<<<<<<<<<<<<<
7098  * info.strides[i] = PyArray_STRIDES(self)[i]
7099  * info.shape[i] = PyArray_DIMS(self)[i]
7100  */
7101  __pyx_t_4 = __pyx_v_ndim;
7102  __pyx_t_5 = __pyx_t_4;
7103  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
7104  __pyx_v_i = __pyx_t_6;
7105 
7106  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
7107  * info.shape = info.strides + ndim
7108  * for i in range(ndim):
7109  * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
7110  * info.shape[i] = PyArray_DIMS(self)[i]
7111  * else:
7112  */
7113  (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
7114 
7115  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":287
7116  * for i in range(ndim):
7117  * info.strides[i] = PyArray_STRIDES(self)[i]
7118  * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
7119  * else:
7120  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
7121  */
7122  (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
7123  }
7124 
7125  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
7126  * info.buf = PyArray_DATA(self)
7127  * info.ndim = ndim
7128  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
7129  * # Allocate new buffer for strides and shape info.
7130  * # This is allocated as one block, strides first.
7131  */
7132  goto __pyx_L9;
7133  }
7134 
7135  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
7136  * info.shape[i] = PyArray_DIMS(self)[i]
7137  * else:
7138  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
7139  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
7140  * info.suboffsets = NULL
7141  */
7142  /*else*/ {
7143  __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
7144 
7145  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
7146  * else:
7147  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
7148  * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
7149  * info.suboffsets = NULL
7150  * info.itemsize = PyArray_ITEMSIZE(self)
7151  */
7152  __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
7153  }
7154  __pyx_L9:;
7155 
7156  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
7157  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
7158  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
7159  * info.suboffsets = NULL # <<<<<<<<<<<<<<
7160  * info.itemsize = PyArray_ITEMSIZE(self)
7161  * info.readonly = not PyArray_ISWRITEABLE(self)
7162  */
7163  __pyx_v_info->suboffsets = NULL;
7164 
7165  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
7166  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
7167  * info.suboffsets = NULL
7168  * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
7169  * info.readonly = not PyArray_ISWRITEABLE(self)
7170  *
7171  */
7172  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
7173 
7174  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
7175  * info.suboffsets = NULL
7176  * info.itemsize = PyArray_ITEMSIZE(self)
7177  * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
7178  *
7179  * cdef int t
7180  */
7181  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
7182 
7183  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":296
7184  *
7185  * cdef int t
7186  * cdef char* f = NULL # <<<<<<<<<<<<<<
7187  * cdef dtype descr = <dtype>PyArray_DESCR(self)
7188  * cdef int offset
7189  */
7190  __pyx_v_f = NULL;
7191 
7192  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
7193  * cdef int t
7194  * cdef char* f = NULL
7195  * cdef dtype descr = <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
7196  * cdef int offset
7197  *
7198  */
7199  __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
7200  __pyx_t_3 = ((PyObject *)__pyx_t_7);
7201  __Pyx_INCREF(__pyx_t_3);
7202  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
7203  __pyx_t_3 = 0;
7204 
7205  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":300
7206  * cdef int offset
7207  *
7208  * info.obj = self # <<<<<<<<<<<<<<
7209  *
7210  * if not PyDataType_HASFIELDS(descr):
7211  */
7212  __Pyx_INCREF(((PyObject *)__pyx_v_self));
7213  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7214  __Pyx_GOTREF(__pyx_v_info->obj);
7215  __Pyx_DECREF(__pyx_v_info->obj);
7216  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7217 
7218  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
7219  * info.obj = self
7220  *
7221  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
7222  * t = descr.type_num
7223  * if ((descr.byteorder == c'>' and little_endian) or
7224  */
7225  __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
7226  if (__pyx_t_1) {
7227 
7228  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":303
7229  *
7230  * if not PyDataType_HASFIELDS(descr):
7231  * t = descr.type_num # <<<<<<<<<<<<<<
7232  * if ((descr.byteorder == c'>' and little_endian) or
7233  * (descr.byteorder == c'<' and not little_endian)):
7234  */
7235  __pyx_t_4 = __pyx_v_descr->type_num;
7236  __pyx_v_t = __pyx_t_4;
7237 
7238  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
7239  * if not PyDataType_HASFIELDS(descr):
7240  * t = descr.type_num
7241  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7242  * (descr.byteorder == c'<' and not little_endian)):
7243  * raise ValueError(u"Non-native byte order not supported")
7244  */
7245  __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
7246  if (!__pyx_t_2) {
7247  goto __pyx_L15_next_or;
7248  } else {
7249  }
7250  __pyx_t_2 = (__pyx_v_little_endian != 0);
7251  if (!__pyx_t_2) {
7252  } else {
7253  __pyx_t_1 = __pyx_t_2;
7254  goto __pyx_L14_bool_binop_done;
7255  }
7256  __pyx_L15_next_or:;
7257 
7258  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":305
7259  * t = descr.type_num
7260  * if ((descr.byteorder == c'>' and little_endian) or
7261  * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
7262  * raise ValueError(u"Non-native byte order not supported")
7263  * if t == NPY_BYTE: f = "b"
7264  */
7265  __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
7266  if (__pyx_t_2) {
7267  } else {
7268  __pyx_t_1 = __pyx_t_2;
7269  goto __pyx_L14_bool_binop_done;
7270  }
7271  __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
7272  __pyx_t_1 = __pyx_t_2;
7273  __pyx_L14_bool_binop_done:;
7274 
7275  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
7276  * if not PyDataType_HASFIELDS(descr):
7277  * t = descr.type_num
7278  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7279  * (descr.byteorder == c'<' and not little_endian)):
7280  * raise ValueError(u"Non-native byte order not supported")
7281  */
7282  if (unlikely(__pyx_t_1)) {
7283 
7284  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
7285  * if ((descr.byteorder == c'>' and little_endian) or
7286  * (descr.byteorder == c'<' and not little_endian)):
7287  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
7288  * if t == NPY_BYTE: f = "b"
7289  * elif t == NPY_UBYTE: f = "B"
7290  */
7291  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 306, __pyx_L1_error)
7292  __Pyx_GOTREF(__pyx_t_3);
7293  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7294  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7295  __PYX_ERR(2, 306, __pyx_L1_error)
7296 
7297  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
7298  * if not PyDataType_HASFIELDS(descr):
7299  * t = descr.type_num
7300  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7301  * (descr.byteorder == c'<' and not little_endian)):
7302  * raise ValueError(u"Non-native byte order not supported")
7303  */
7304  }
7305 
7306  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":307
7307  * (descr.byteorder == c'<' and not little_endian)):
7308  * raise ValueError(u"Non-native byte order not supported")
7309  * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
7310  * elif t == NPY_UBYTE: f = "B"
7311  * elif t == NPY_SHORT: f = "h"
7312  */
7313  switch (__pyx_v_t) {
7314  case NPY_BYTE:
7315  __pyx_v_f = ((char *)"b");
7316  break;
7317  case NPY_UBYTE:
7318 
7319  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":308
7320  * raise ValueError(u"Non-native byte order not supported")
7321  * if t == NPY_BYTE: f = "b"
7322  * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
7323  * elif t == NPY_SHORT: f = "h"
7324  * elif t == NPY_USHORT: f = "H"
7325  */
7326  __pyx_v_f = ((char *)"B");
7327  break;
7328  case NPY_SHORT:
7329 
7330  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":309
7331  * if t == NPY_BYTE: f = "b"
7332  * elif t == NPY_UBYTE: f = "B"
7333  * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
7334  * elif t == NPY_USHORT: f = "H"
7335  * elif t == NPY_INT: f = "i"
7336  */
7337  __pyx_v_f = ((char *)"h");
7338  break;
7339  case NPY_USHORT:
7340 
7341  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":310
7342  * elif t == NPY_UBYTE: f = "B"
7343  * elif t == NPY_SHORT: f = "h"
7344  * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
7345  * elif t == NPY_INT: f = "i"
7346  * elif t == NPY_UINT: f = "I"
7347  */
7348  __pyx_v_f = ((char *)"H");
7349  break;
7350  case NPY_INT:
7351 
7352  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":311
7353  * elif t == NPY_SHORT: f = "h"
7354  * elif t == NPY_USHORT: f = "H"
7355  * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
7356  * elif t == NPY_UINT: f = "I"
7357  * elif t == NPY_LONG: f = "l"
7358  */
7359  __pyx_v_f = ((char *)"i");
7360  break;
7361  case NPY_UINT:
7362 
7363  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":312
7364  * elif t == NPY_USHORT: f = "H"
7365  * elif t == NPY_INT: f = "i"
7366  * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
7367  * elif t == NPY_LONG: f = "l"
7368  * elif t == NPY_ULONG: f = "L"
7369  */
7370  __pyx_v_f = ((char *)"I");
7371  break;
7372  case NPY_LONG:
7373 
7374  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":313
7375  * elif t == NPY_INT: f = "i"
7376  * elif t == NPY_UINT: f = "I"
7377  * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
7378  * elif t == NPY_ULONG: f = "L"
7379  * elif t == NPY_LONGLONG: f = "q"
7380  */
7381  __pyx_v_f = ((char *)"l");
7382  break;
7383  case NPY_ULONG:
7384 
7385  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":314
7386  * elif t == NPY_UINT: f = "I"
7387  * elif t == NPY_LONG: f = "l"
7388  * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
7389  * elif t == NPY_LONGLONG: f = "q"
7390  * elif t == NPY_ULONGLONG: f = "Q"
7391  */
7392  __pyx_v_f = ((char *)"L");
7393  break;
7394  case NPY_LONGLONG:
7395 
7396  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":315
7397  * elif t == NPY_LONG: f = "l"
7398  * elif t == NPY_ULONG: f = "L"
7399  * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
7400  * elif t == NPY_ULONGLONG: f = "Q"
7401  * elif t == NPY_FLOAT: f = "f"
7402  */
7403  __pyx_v_f = ((char *)"q");
7404  break;
7405  case NPY_ULONGLONG:
7406 
7407  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":316
7408  * elif t == NPY_ULONG: f = "L"
7409  * elif t == NPY_LONGLONG: f = "q"
7410  * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
7411  * elif t == NPY_FLOAT: f = "f"
7412  * elif t == NPY_DOUBLE: f = "d"
7413  */
7414  __pyx_v_f = ((char *)"Q");
7415  break;
7416  case NPY_FLOAT:
7417 
7418  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":317
7419  * elif t == NPY_LONGLONG: f = "q"
7420  * elif t == NPY_ULONGLONG: f = "Q"
7421  * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
7422  * elif t == NPY_DOUBLE: f = "d"
7423  * elif t == NPY_LONGDOUBLE: f = "g"
7424  */
7425  __pyx_v_f = ((char *)"f");
7426  break;
7427  case NPY_DOUBLE:
7428 
7429  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":318
7430  * elif t == NPY_ULONGLONG: f = "Q"
7431  * elif t == NPY_FLOAT: f = "f"
7432  * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
7433  * elif t == NPY_LONGDOUBLE: f = "g"
7434  * elif t == NPY_CFLOAT: f = "Zf"
7435  */
7436  __pyx_v_f = ((char *)"d");
7437  break;
7438  case NPY_LONGDOUBLE:
7439 
7440  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":319
7441  * elif t == NPY_FLOAT: f = "f"
7442  * elif t == NPY_DOUBLE: f = "d"
7443  * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
7444  * elif t == NPY_CFLOAT: f = "Zf"
7445  * elif t == NPY_CDOUBLE: f = "Zd"
7446  */
7447  __pyx_v_f = ((char *)"g");
7448  break;
7449  case NPY_CFLOAT:
7450 
7451  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":320
7452  * elif t == NPY_DOUBLE: f = "d"
7453  * elif t == NPY_LONGDOUBLE: f = "g"
7454  * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
7455  * elif t == NPY_CDOUBLE: f = "Zd"
7456  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7457  */
7458  __pyx_v_f = ((char *)"Zf");
7459  break;
7460  case NPY_CDOUBLE:
7461 
7462  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":321
7463  * elif t == NPY_LONGDOUBLE: f = "g"
7464  * elif t == NPY_CFLOAT: f = "Zf"
7465  * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
7466  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7467  * elif t == NPY_OBJECT: f = "O"
7468  */
7469  __pyx_v_f = ((char *)"Zd");
7470  break;
7471  case NPY_CLONGDOUBLE:
7472 
7473  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":322
7474  * elif t == NPY_CFLOAT: f = "Zf"
7475  * elif t == NPY_CDOUBLE: f = "Zd"
7476  * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
7477  * elif t == NPY_OBJECT: f = "O"
7478  * else:
7479  */
7480  __pyx_v_f = ((char *)"Zg");
7481  break;
7482  case NPY_OBJECT:
7483 
7484  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":323
7485  * elif t == NPY_CDOUBLE: f = "Zd"
7486  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7487  * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
7488  * else:
7489  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7490  */
7491  __pyx_v_f = ((char *)"O");
7492  break;
7493  default:
7494 
7495  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":325
7496  * elif t == NPY_OBJECT: f = "O"
7497  * else:
7498  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
7499  * info.format = f
7500  * return
7501  */
7502  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
7503  __Pyx_GOTREF(__pyx_t_3);
7504  __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 325, __pyx_L1_error)
7505  __Pyx_GOTREF(__pyx_t_8);
7506  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7507  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
7508  __Pyx_GOTREF(__pyx_t_3);
7509  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7510  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7511  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7512  __PYX_ERR(2, 325, __pyx_L1_error)
7513  break;
7514  }
7515 
7516  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":326
7517  * else:
7518  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7519  * info.format = f # <<<<<<<<<<<<<<
7520  * return
7521  * else:
7522  */
7523  __pyx_v_info->format = __pyx_v_f;
7524 
7525  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":327
7526  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7527  * info.format = f
7528  * return # <<<<<<<<<<<<<<
7529  * else:
7530  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7531  */
7532  __pyx_r = 0;
7533  goto __pyx_L0;
7534 
7535  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
7536  * info.obj = self
7537  *
7538  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
7539  * t = descr.type_num
7540  * if ((descr.byteorder == c'>' and little_endian) or
7541  */
7542  }
7543 
7544  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":329
7545  * return
7546  * else:
7547  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
7548  * info.format[0] = c'^' # Native data types, manual alignment
7549  * offset = 0
7550  */
7551  /*else*/ {
7552  __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
7553 
7554  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":330
7555  * else:
7556  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7557  * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
7558  * offset = 0
7559  * f = _util_dtypestring(descr, info.format + 1,
7560  */
7561  (__pyx_v_info->format[0]) = '^';
7562 
7563  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":331
7564  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7565  * info.format[0] = c'^' # Native data types, manual alignment
7566  * offset = 0 # <<<<<<<<<<<<<<
7567  * f = _util_dtypestring(descr, info.format + 1,
7568  * info.format + _buffer_format_string_len,
7569  */
7570  __pyx_v_offset = 0;
7571 
7572  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":332
7573  * info.format[0] = c'^' # Native data types, manual alignment
7574  * offset = 0
7575  * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
7576  * info.format + _buffer_format_string_len,
7577  * &offset)
7578  */
7579  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 332, __pyx_L1_error)
7580  __pyx_v_f = __pyx_t_9;
7581 
7582  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":335
7583  * info.format + _buffer_format_string_len,
7584  * &offset)
7585  * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
7586  *
7587  * def __releasebuffer__(ndarray self, Py_buffer* info):
7588  */
7589  (__pyx_v_f[0]) = '\x00';
7590  }
7591 
7592  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
7593  * # experimental exception made for __getbuffer__ and __releasebuffer__
7594  * # -- the details of this may change.
7595  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
7596  * # This implementation of getbuffer is geared towards Cython
7597  * # requirements, and does not yet fulfill the PEP.
7598  */
7599 
7600  /* function exit code */
7601  __pyx_r = 0;
7602  goto __pyx_L0;
7603  __pyx_L1_error:;
7604  __Pyx_XDECREF(__pyx_t_3);
7605  __Pyx_XDECREF(__pyx_t_8);
7606  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7607  __pyx_r = -1;
7608  if (__pyx_v_info->obj != NULL) {
7609  __Pyx_GOTREF(__pyx_v_info->obj);
7610  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7611  }
7612  goto __pyx_L2;
7613  __pyx_L0:;
7614  if (__pyx_v_info->obj == Py_None) {
7615  __Pyx_GOTREF(__pyx_v_info->obj);
7616  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7617  }
7618  __pyx_L2:;
7619  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
7620  __Pyx_RefNannyFinishContext();
7621  return __pyx_r;
7622 }
7623 
7624 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
7625  * f[0] = c'\0' # Terminate format string
7626  *
7627  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
7628  * if PyArray_HASFIELDS(self):
7629  * PyObject_Free(info.format)
7630  */
7631 
7632 /* Python wrapper */
7633 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
7634 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7635  __Pyx_RefNannyDeclarations
7636  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
7637  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
7638 
7639  /* function exit code */
7640  __Pyx_RefNannyFinishContext();
7641 }
7642 
7643 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7644  __Pyx_RefNannyDeclarations
7645  int __pyx_t_1;
7646  __Pyx_RefNannySetupContext("__releasebuffer__", 0);
7647 
7648  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
7649  *
7650  * def __releasebuffer__(ndarray self, Py_buffer* info):
7651  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
7652  * PyObject_Free(info.format)
7653  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7654  */
7655  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
7656  if (__pyx_t_1) {
7657 
7658  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":339
7659  * def __releasebuffer__(ndarray self, Py_buffer* info):
7660  * if PyArray_HASFIELDS(self):
7661  * PyObject_Free(info.format) # <<<<<<<<<<<<<<
7662  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7663  * PyObject_Free(info.strides)
7664  */
7665  PyObject_Free(__pyx_v_info->format);
7666 
7667  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
7668  *
7669  * def __releasebuffer__(ndarray self, Py_buffer* info):
7670  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
7671  * PyObject_Free(info.format)
7672  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7673  */
7674  }
7675 
7676  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
7677  * if PyArray_HASFIELDS(self):
7678  * PyObject_Free(info.format)
7679  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
7680  * PyObject_Free(info.strides)
7681  * # info.shape was stored after info.strides in the same block
7682  */
7683  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
7684  if (__pyx_t_1) {
7685 
7686  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":341
7687  * PyObject_Free(info.format)
7688  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7689  * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
7690  * # info.shape was stored after info.strides in the same block
7691  *
7692  */
7693  PyObject_Free(__pyx_v_info->strides);
7694 
7695  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
7696  * if PyArray_HASFIELDS(self):
7697  * PyObject_Free(info.format)
7698  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
7699  * PyObject_Free(info.strides)
7700  * # info.shape was stored after info.strides in the same block
7701  */
7702  }
7703 
7704  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
7705  * f[0] = c'\0' # Terminate format string
7706  *
7707  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
7708  * if PyArray_HASFIELDS(self):
7709  * PyObject_Free(info.format)
7710  */
7711 
7712  /* function exit code */
7713  __Pyx_RefNannyFinishContext();
7714 }
7715 
7716 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
7717  * ctypedef npy_cdouble complex_t
7718  *
7719  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7720  * return PyArray_MultiIterNew(1, <void*>a)
7721  *
7722  */
7723 
7724 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7725  PyObject *__pyx_r = NULL;
7726  __Pyx_RefNannyDeclarations
7727  PyObject *__pyx_t_1 = NULL;
7728  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
7729 
7730  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
7731  *
7732  * cdef inline object PyArray_MultiIterNew1(a):
7733  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
7734  *
7735  * cdef inline object PyArray_MultiIterNew2(a, b):
7736  */
7737  __Pyx_XDECREF(__pyx_r);
7738  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 822, __pyx_L1_error)
7739  __Pyx_GOTREF(__pyx_t_1);
7740  __pyx_r = __pyx_t_1;
7741  __pyx_t_1 = 0;
7742  goto __pyx_L0;
7743 
7744  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
7745  * ctypedef npy_cdouble complex_t
7746  *
7747  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7748  * return PyArray_MultiIterNew(1, <void*>a)
7749  *
7750  */
7751 
7752  /* function exit code */
7753  __pyx_L1_error:;
7754  __Pyx_XDECREF(__pyx_t_1);
7755  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7756  __pyx_r = 0;
7757  __pyx_L0:;
7758  __Pyx_XGIVEREF(__pyx_r);
7759  __Pyx_RefNannyFinishContext();
7760  return __pyx_r;
7761 }
7762 
7763 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
7764  * return PyArray_MultiIterNew(1, <void*>a)
7765  *
7766  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7767  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7768  *
7769  */
7770 
7771 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7772  PyObject *__pyx_r = NULL;
7773  __Pyx_RefNannyDeclarations
7774  PyObject *__pyx_t_1 = NULL;
7775  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
7776 
7777  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":825
7778  *
7779  * cdef inline object PyArray_MultiIterNew2(a, b):
7780  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
7781  *
7782  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7783  */
7784  __Pyx_XDECREF(__pyx_r);
7785  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 825, __pyx_L1_error)
7786  __Pyx_GOTREF(__pyx_t_1);
7787  __pyx_r = __pyx_t_1;
7788  __pyx_t_1 = 0;
7789  goto __pyx_L0;
7790 
7791  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
7792  * return PyArray_MultiIterNew(1, <void*>a)
7793  *
7794  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7795  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7796  *
7797  */
7798 
7799  /* function exit code */
7800  __pyx_L1_error:;
7801  __Pyx_XDECREF(__pyx_t_1);
7802  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7803  __pyx_r = 0;
7804  __pyx_L0:;
7805  __Pyx_XGIVEREF(__pyx_r);
7806  __Pyx_RefNannyFinishContext();
7807  return __pyx_r;
7808 }
7809 
7810 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
7811  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7812  *
7813  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7814  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7815  *
7816  */
7817 
7818 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7819  PyObject *__pyx_r = NULL;
7820  __Pyx_RefNannyDeclarations
7821  PyObject *__pyx_t_1 = NULL;
7822  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
7823 
7824  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
7825  *
7826  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7827  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
7828  *
7829  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7830  */
7831  __Pyx_XDECREF(__pyx_r);
7832  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 828, __pyx_L1_error)
7833  __Pyx_GOTREF(__pyx_t_1);
7834  __pyx_r = __pyx_t_1;
7835  __pyx_t_1 = 0;
7836  goto __pyx_L0;
7837 
7838  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
7839  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7840  *
7841  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7842  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7843  *
7844  */
7845 
7846  /* function exit code */
7847  __pyx_L1_error:;
7848  __Pyx_XDECREF(__pyx_t_1);
7849  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7850  __pyx_r = 0;
7851  __pyx_L0:;
7852  __Pyx_XGIVEREF(__pyx_r);
7853  __Pyx_RefNannyFinishContext();
7854  return __pyx_r;
7855 }
7856 
7857 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
7858  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7859  *
7860  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7861  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7862  *
7863  */
7864 
7865 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
7866  PyObject *__pyx_r = NULL;
7867  __Pyx_RefNannyDeclarations
7868  PyObject *__pyx_t_1 = NULL;
7869  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
7870 
7871  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
7872  *
7873  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7874  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
7875  *
7876  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7877  */
7878  __Pyx_XDECREF(__pyx_r);
7879  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 831, __pyx_L1_error)
7880  __Pyx_GOTREF(__pyx_t_1);
7881  __pyx_r = __pyx_t_1;
7882  __pyx_t_1 = 0;
7883  goto __pyx_L0;
7884 
7885  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
7886  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7887  *
7888  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7889  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7890  *
7891  */
7892 
7893  /* function exit code */
7894  __pyx_L1_error:;
7895  __Pyx_XDECREF(__pyx_t_1);
7896  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7897  __pyx_r = 0;
7898  __pyx_L0:;
7899  __Pyx_XGIVEREF(__pyx_r);
7900  __Pyx_RefNannyFinishContext();
7901  return __pyx_r;
7902 }
7903 
7904 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
7905  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7906  *
7907  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7908  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7909  *
7910  */
7911 
7912 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7913  PyObject *__pyx_r = NULL;
7914  __Pyx_RefNannyDeclarations
7915  PyObject *__pyx_t_1 = NULL;
7916  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
7917 
7918  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
7919  *
7920  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7921  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
7922  *
7923  * cdef inline tuple PyDataType_SHAPE(dtype d):
7924  */
7925  __Pyx_XDECREF(__pyx_r);
7926  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 834, __pyx_L1_error)
7927  __Pyx_GOTREF(__pyx_t_1);
7928  __pyx_r = __pyx_t_1;
7929  __pyx_t_1 = 0;
7930  goto __pyx_L0;
7931 
7932  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
7933  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7934  *
7935  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7936  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7937  *
7938  */
7939 
7940  /* function exit code */
7941  __pyx_L1_error:;
7942  __Pyx_XDECREF(__pyx_t_1);
7943  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7944  __pyx_r = 0;
7945  __pyx_L0:;
7946  __Pyx_XGIVEREF(__pyx_r);
7947  __Pyx_RefNannyFinishContext();
7948  return __pyx_r;
7949 }
7950 
7951 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
7952  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7953  *
7954  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7955  * if PyDataType_HASSUBARRAY(d):
7956  * return <tuple>d.subarray.shape
7957  */
7958 
7959 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7960  PyObject *__pyx_r = NULL;
7961  __Pyx_RefNannyDeclarations
7962  int __pyx_t_1;
7963  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
7964 
7965  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
7966  *
7967  * cdef inline tuple PyDataType_SHAPE(dtype d):
7968  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7969  * return <tuple>d.subarray.shape
7970  * else:
7971  */
7972  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7973  if (__pyx_t_1) {
7974 
7975  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
7976  * cdef inline tuple PyDataType_SHAPE(dtype d):
7977  * if PyDataType_HASSUBARRAY(d):
7978  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
7979  * else:
7980  * return ()
7981  */
7982  __Pyx_XDECREF(__pyx_r);
7983  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7984  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7985  goto __pyx_L0;
7986 
7987  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
7988  *
7989  * cdef inline tuple PyDataType_SHAPE(dtype d):
7990  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7991  * return <tuple>d.subarray.shape
7992  * else:
7993  */
7994  }
7995 
7996  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
7997  * return <tuple>d.subarray.shape
7998  * else:
7999  * return () # <<<<<<<<<<<<<<
8000  *
8001  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
8002  */
8003  /*else*/ {
8004  __Pyx_XDECREF(__pyx_r);
8005  __Pyx_INCREF(__pyx_empty_tuple);
8006  __pyx_r = __pyx_empty_tuple;
8007  goto __pyx_L0;
8008  }
8009 
8010  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
8011  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
8012  *
8013  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
8014  * if PyDataType_HASSUBARRAY(d):
8015  * return <tuple>d.subarray.shape
8016  */
8017 
8018  /* function exit code */
8019  __pyx_L0:;
8020  __Pyx_XGIVEREF(__pyx_r);
8021  __Pyx_RefNannyFinishContext();
8022  return __pyx_r;
8023 }
8024 
8025 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
8026  * return ()
8027  *
8028  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
8029  * # Recursive utility function used in __getbuffer__ to get format
8030  * # string. The new location in the format string is returned.
8031  */
8032 
8033 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
8034  PyArray_Descr *__pyx_v_child = 0;
8035  int __pyx_v_endian_detector;
8036  int __pyx_v_little_endian;
8037  PyObject *__pyx_v_fields = 0;
8038  PyObject *__pyx_v_childname = NULL;
8039  PyObject *__pyx_v_new_offset = NULL;
8040  PyObject *__pyx_v_t = NULL;
8041  char *__pyx_r;
8042  __Pyx_RefNannyDeclarations
8043  PyObject *__pyx_t_1 = NULL;
8044  Py_ssize_t __pyx_t_2;
8045  PyObject *__pyx_t_3 = NULL;
8046  PyObject *__pyx_t_4 = NULL;
8047  int __pyx_t_5;
8048  int __pyx_t_6;
8049  int __pyx_t_7;
8050  long __pyx_t_8;
8051  char *__pyx_t_9;
8052  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
8053 
8054  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":847
8055  *
8056  * cdef dtype child
8057  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
8058  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
8059  * cdef tuple fields
8060  */
8061  __pyx_v_endian_detector = 1;
8062 
8063  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":848
8064  * cdef dtype child
8065  * cdef int endian_detector = 1
8066  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
8067  * cdef tuple fields
8068  *
8069  */
8070  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
8071 
8072  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
8073  * cdef tuple fields
8074  *
8075  * for childname in descr.names: # <<<<<<<<<<<<<<
8076  * fields = descr.fields[childname]
8077  * child, new_offset = fields
8078  */
8079  if (unlikely(__pyx_v_descr->names == Py_None)) {
8080  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
8081  __PYX_ERR(2, 851, __pyx_L1_error)
8082  }
8083  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
8084  for (;;) {
8085  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
8086  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8087  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 851, __pyx_L1_error)
8088  #else
8089  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 851, __pyx_L1_error)
8090  __Pyx_GOTREF(__pyx_t_3);
8091  #endif
8092  __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
8093  __pyx_t_3 = 0;
8094 
8095  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":852
8096  *
8097  * for childname in descr.names:
8098  * fields = descr.fields[childname] # <<<<<<<<<<<<<<
8099  * child, new_offset = fields
8100  *
8101  */
8102  if (unlikely(__pyx_v_descr->fields == Py_None)) {
8103  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
8104  __PYX_ERR(2, 852, __pyx_L1_error)
8105  }
8106  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 852, __pyx_L1_error)
8107  __Pyx_GOTREF(__pyx_t_3);
8108  if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 852, __pyx_L1_error)
8109  __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
8110  __pyx_t_3 = 0;
8111 
8112  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":853
8113  * for childname in descr.names:
8114  * fields = descr.fields[childname]
8115  * child, new_offset = fields # <<<<<<<<<<<<<<
8116  *
8117  * if (end - f) - <int>(new_offset - offset[0]) < 15:
8118  */
8119  if (likely(__pyx_v_fields != Py_None)) {
8120  PyObject* sequence = __pyx_v_fields;
8121  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8122  if (unlikely(size != 2)) {
8123  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8124  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8125  __PYX_ERR(2, 853, __pyx_L1_error)
8126  }
8127  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8128  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
8129  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
8130  __Pyx_INCREF(__pyx_t_3);
8131  __Pyx_INCREF(__pyx_t_4);
8132  #else
8133  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
8134  __Pyx_GOTREF(__pyx_t_3);
8135  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
8136  __Pyx_GOTREF(__pyx_t_4);
8137  #endif
8138  } else {
8139  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 853, __pyx_L1_error)
8140  }
8141  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 853, __pyx_L1_error)
8142  __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
8143  __pyx_t_3 = 0;
8144  __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
8145  __pyx_t_4 = 0;
8146 
8147  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
8148  * child, new_offset = fields
8149  *
8150  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
8151  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8152  *
8153  */
8154  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
8155  __Pyx_GOTREF(__pyx_t_4);
8156  __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
8157  __Pyx_GOTREF(__pyx_t_3);
8158  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8159  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 855, __pyx_L1_error)
8160  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8161  __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
8162  if (unlikely(__pyx_t_6)) {
8163 
8164  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
8165  *
8166  * if (end - f) - <int>(new_offset - offset[0]) < 15:
8167  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
8168  *
8169  * if ((child.byteorder == c'>' and little_endian) or
8170  */
8171  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 856, __pyx_L1_error)
8172  __Pyx_GOTREF(__pyx_t_3);
8173  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8174  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8175  __PYX_ERR(2, 856, __pyx_L1_error)
8176 
8177  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
8178  * child, new_offset = fields
8179  *
8180  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
8181  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8182  *
8183  */
8184  }
8185 
8186  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
8187  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8188  *
8189  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
8190  * (child.byteorder == c'<' and not little_endian)):
8191  * raise ValueError(u"Non-native byte order not supported")
8192  */
8193  __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
8194  if (!__pyx_t_7) {
8195  goto __pyx_L8_next_or;
8196  } else {
8197  }
8198  __pyx_t_7 = (__pyx_v_little_endian != 0);
8199  if (!__pyx_t_7) {
8200  } else {
8201  __pyx_t_6 = __pyx_t_7;
8202  goto __pyx_L7_bool_binop_done;
8203  }
8204  __pyx_L8_next_or:;
8205 
8206  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":859
8207  *
8208  * if ((child.byteorder == c'>' and little_endian) or
8209  * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
8210  * raise ValueError(u"Non-native byte order not supported")
8211  * # One could encode it in the format string and have Cython
8212  */
8213  __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
8214  if (__pyx_t_7) {
8215  } else {
8216  __pyx_t_6 = __pyx_t_7;
8217  goto __pyx_L7_bool_binop_done;
8218  }
8219  __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
8220  __pyx_t_6 = __pyx_t_7;
8221  __pyx_L7_bool_binop_done:;
8222 
8223  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
8224  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8225  *
8226  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
8227  * (child.byteorder == c'<' and not little_endian)):
8228  * raise ValueError(u"Non-native byte order not supported")
8229  */
8230  if (unlikely(__pyx_t_6)) {
8231 
8232  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":860
8233  * if ((child.byteorder == c'>' and little_endian) or
8234  * (child.byteorder == c'<' and not little_endian)):
8235  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
8236  * # One could encode it in the format string and have Cython
8237  * # complain instead, BUT: < and > in format strings also imply
8238  */
8239  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 860, __pyx_L1_error)
8240  __Pyx_GOTREF(__pyx_t_3);
8241  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8242  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8243  __PYX_ERR(2, 860, __pyx_L1_error)
8244 
8245  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
8246  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8247  *
8248  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
8249  * (child.byteorder == c'<' and not little_endian)):
8250  * raise ValueError(u"Non-native byte order not supported")
8251  */
8252  }
8253 
8254  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":870
8255  *
8256  * # Output padding bytes
8257  * while offset[0] < new_offset: # <<<<<<<<<<<<<<
8258  * f[0] = 120 # "x"; pad byte
8259  * f += 1
8260  */
8261  while (1) {
8262  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 870, __pyx_L1_error)
8263  __Pyx_GOTREF(__pyx_t_3);
8264  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 870, __pyx_L1_error)
8265  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8266  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 870, __pyx_L1_error)
8267  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8268  if (!__pyx_t_6) break;
8269 
8270  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":871
8271  * # Output padding bytes
8272  * while offset[0] < new_offset:
8273  * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
8274  * f += 1
8275  * offset[0] += 1
8276  */
8277  (__pyx_v_f[0]) = 0x78;
8278 
8279  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":872
8280  * while offset[0] < new_offset:
8281  * f[0] = 120 # "x"; pad byte
8282  * f += 1 # <<<<<<<<<<<<<<
8283  * offset[0] += 1
8284  *
8285  */
8286  __pyx_v_f = (__pyx_v_f + 1);
8287 
8288  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":873
8289  * f[0] = 120 # "x"; pad byte
8290  * f += 1
8291  * offset[0] += 1 # <<<<<<<<<<<<<<
8292  *
8293  * offset[0] += child.itemsize
8294  */
8295  __pyx_t_8 = 0;
8296  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
8297  }
8298 
8299  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":875
8300  * offset[0] += 1
8301  *
8302  * offset[0] += child.itemsize # <<<<<<<<<<<<<<
8303  *
8304  * if not PyDataType_HASFIELDS(child):
8305  */
8306  __pyx_t_8 = 0;
8307  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
8308 
8309  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
8310  * offset[0] += child.itemsize
8311  *
8312  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
8313  * t = child.type_num
8314  * if end - f < 5:
8315  */
8316  __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
8317  if (__pyx_t_6) {
8318 
8319  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":878
8320  *
8321  * if not PyDataType_HASFIELDS(child):
8322  * t = child.type_num # <<<<<<<<<<<<<<
8323  * if end - f < 5:
8324  * raise RuntimeError(u"Format string allocated too short.")
8325  */
8326  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 878, __pyx_L1_error)
8327  __Pyx_GOTREF(__pyx_t_4);
8328  __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
8329  __pyx_t_4 = 0;
8330 
8331  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
8332  * if not PyDataType_HASFIELDS(child):
8333  * t = child.type_num
8334  * if end - f < 5: # <<<<<<<<<<<<<<
8335  * raise RuntimeError(u"Format string allocated too short.")
8336  *
8337  */
8338  __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
8339  if (unlikely(__pyx_t_6)) {
8340 
8341  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
8342  * t = child.type_num
8343  * if end - f < 5:
8344  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
8345  *
8346  * # Until ticket #99 is fixed, use integers to avoid warnings
8347  */
8348  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 880, __pyx_L1_error)
8349  __Pyx_GOTREF(__pyx_t_4);
8350  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8351  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8352  __PYX_ERR(2, 880, __pyx_L1_error)
8353 
8354  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
8355  * if not PyDataType_HASFIELDS(child):
8356  * t = child.type_num
8357  * if end - f < 5: # <<<<<<<<<<<<<<
8358  * raise RuntimeError(u"Format string allocated too short.")
8359  *
8360  */
8361  }
8362 
8363  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":883
8364  *
8365  * # Until ticket #99 is fixed, use integers to avoid warnings
8366  * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
8367  * elif t == NPY_UBYTE: f[0] = 66 #"B"
8368  * elif t == NPY_SHORT: f[0] = 104 #"h"
8369  */
8370  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 883, __pyx_L1_error)
8371  __Pyx_GOTREF(__pyx_t_4);
8372  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 883, __pyx_L1_error)
8373  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8374  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 883, __pyx_L1_error)
8375  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8376  if (__pyx_t_6) {
8377  (__pyx_v_f[0]) = 98;
8378  goto __pyx_L15;
8379  }
8380 
8381  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":884
8382  * # Until ticket #99 is fixed, use integers to avoid warnings
8383  * if t == NPY_BYTE: f[0] = 98 #"b"
8384  * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
8385  * elif t == NPY_SHORT: f[0] = 104 #"h"
8386  * elif t == NPY_USHORT: f[0] = 72 #"H"
8387  */
8388  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 884, __pyx_L1_error)
8389  __Pyx_GOTREF(__pyx_t_3);
8390  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 884, __pyx_L1_error)
8391  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8392  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 884, __pyx_L1_error)
8393  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8394  if (__pyx_t_6) {
8395  (__pyx_v_f[0]) = 66;
8396  goto __pyx_L15;
8397  }
8398 
8399  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":885
8400  * if t == NPY_BYTE: f[0] = 98 #"b"
8401  * elif t == NPY_UBYTE: f[0] = 66 #"B"
8402  * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
8403  * elif t == NPY_USHORT: f[0] = 72 #"H"
8404  * elif t == NPY_INT: f[0] = 105 #"i"
8405  */
8406  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 885, __pyx_L1_error)
8407  __Pyx_GOTREF(__pyx_t_4);
8408  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 885, __pyx_L1_error)
8409  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8410  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 885, __pyx_L1_error)
8411  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8412  if (__pyx_t_6) {
8413  (__pyx_v_f[0]) = 0x68;
8414  goto __pyx_L15;
8415  }
8416 
8417  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":886
8418  * elif t == NPY_UBYTE: f[0] = 66 #"B"
8419  * elif t == NPY_SHORT: f[0] = 104 #"h"
8420  * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
8421  * elif t == NPY_INT: f[0] = 105 #"i"
8422  * elif t == NPY_UINT: f[0] = 73 #"I"
8423  */
8424  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 886, __pyx_L1_error)
8425  __Pyx_GOTREF(__pyx_t_3);
8426  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 886, __pyx_L1_error)
8427  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8428  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 886, __pyx_L1_error)
8429  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8430  if (__pyx_t_6) {
8431  (__pyx_v_f[0]) = 72;
8432  goto __pyx_L15;
8433  }
8434 
8435  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":887
8436  * elif t == NPY_SHORT: f[0] = 104 #"h"
8437  * elif t == NPY_USHORT: f[0] = 72 #"H"
8438  * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
8439  * elif t == NPY_UINT: f[0] = 73 #"I"
8440  * elif t == NPY_LONG: f[0] = 108 #"l"
8441  */
8442  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 887, __pyx_L1_error)
8443  __Pyx_GOTREF(__pyx_t_4);
8444  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 887, __pyx_L1_error)
8445  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8446  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 887, __pyx_L1_error)
8447  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8448  if (__pyx_t_6) {
8449  (__pyx_v_f[0]) = 0x69;
8450  goto __pyx_L15;
8451  }
8452 
8453  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":888
8454  * elif t == NPY_USHORT: f[0] = 72 #"H"
8455  * elif t == NPY_INT: f[0] = 105 #"i"
8456  * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
8457  * elif t == NPY_LONG: f[0] = 108 #"l"
8458  * elif t == NPY_ULONG: f[0] = 76 #"L"
8459  */
8460  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 888, __pyx_L1_error)
8461  __Pyx_GOTREF(__pyx_t_3);
8462  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 888, __pyx_L1_error)
8463  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8464  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 888, __pyx_L1_error)
8465  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8466  if (__pyx_t_6) {
8467  (__pyx_v_f[0]) = 73;
8468  goto __pyx_L15;
8469  }
8470 
8471  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":889
8472  * elif t == NPY_INT: f[0] = 105 #"i"
8473  * elif t == NPY_UINT: f[0] = 73 #"I"
8474  * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
8475  * elif t == NPY_ULONG: f[0] = 76 #"L"
8476  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8477  */
8478  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 889, __pyx_L1_error)
8479  __Pyx_GOTREF(__pyx_t_4);
8480  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 889, __pyx_L1_error)
8481  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8482  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 889, __pyx_L1_error)
8483  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8484  if (__pyx_t_6) {
8485  (__pyx_v_f[0]) = 0x6C;
8486  goto __pyx_L15;
8487  }
8488 
8489  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":890
8490  * elif t == NPY_UINT: f[0] = 73 #"I"
8491  * elif t == NPY_LONG: f[0] = 108 #"l"
8492  * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
8493  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8494  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8495  */
8496  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 890, __pyx_L1_error)
8497  __Pyx_GOTREF(__pyx_t_3);
8498  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 890, __pyx_L1_error)
8499  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8500  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 890, __pyx_L1_error)
8501  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8502  if (__pyx_t_6) {
8503  (__pyx_v_f[0]) = 76;
8504  goto __pyx_L15;
8505  }
8506 
8507  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":891
8508  * elif t == NPY_LONG: f[0] = 108 #"l"
8509  * elif t == NPY_ULONG: f[0] = 76 #"L"
8510  * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
8511  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8512  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8513  */
8514  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 891, __pyx_L1_error)
8515  __Pyx_GOTREF(__pyx_t_4);
8516  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 891, __pyx_L1_error)
8517  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8518  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 891, __pyx_L1_error)
8519  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8520  if (__pyx_t_6) {
8521  (__pyx_v_f[0]) = 0x71;
8522  goto __pyx_L15;
8523  }
8524 
8525  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":892
8526  * elif t == NPY_ULONG: f[0] = 76 #"L"
8527  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8528  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
8529  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8530  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8531  */
8532  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 892, __pyx_L1_error)
8533  __Pyx_GOTREF(__pyx_t_3);
8534  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 892, __pyx_L1_error)
8535  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8536  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 892, __pyx_L1_error)
8537  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8538  if (__pyx_t_6) {
8539  (__pyx_v_f[0]) = 81;
8540  goto __pyx_L15;
8541  }
8542 
8543  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":893
8544  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8545  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8546  * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
8547  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8548  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8549  */
8550  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 893, __pyx_L1_error)
8551  __Pyx_GOTREF(__pyx_t_4);
8552  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 893, __pyx_L1_error)
8553  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8554  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 893, __pyx_L1_error)
8555  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8556  if (__pyx_t_6) {
8557  (__pyx_v_f[0]) = 0x66;
8558  goto __pyx_L15;
8559  }
8560 
8561  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":894
8562  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8563  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8564  * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
8565  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8566  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8567  */
8568  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 894, __pyx_L1_error)
8569  __Pyx_GOTREF(__pyx_t_3);
8570  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 894, __pyx_L1_error)
8571  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8572  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 894, __pyx_L1_error)
8573  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8574  if (__pyx_t_6) {
8575  (__pyx_v_f[0]) = 0x64;
8576  goto __pyx_L15;
8577  }
8578 
8579  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":895
8580  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8581  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8582  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
8583  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8584  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8585  */
8586  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 895, __pyx_L1_error)
8587  __Pyx_GOTREF(__pyx_t_4);
8588  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 895, __pyx_L1_error)
8589  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8590  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 895, __pyx_L1_error)
8591  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8592  if (__pyx_t_6) {
8593  (__pyx_v_f[0]) = 0x67;
8594  goto __pyx_L15;
8595  }
8596 
8597  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":896
8598  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8599  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8600  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
8601  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8602  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8603  */
8604  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 896, __pyx_L1_error)
8605  __Pyx_GOTREF(__pyx_t_3);
8606  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 896, __pyx_L1_error)
8607  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8608  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 896, __pyx_L1_error)
8609  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8610  if (__pyx_t_6) {
8611  (__pyx_v_f[0]) = 90;
8612  (__pyx_v_f[1]) = 0x66;
8613  __pyx_v_f = (__pyx_v_f + 1);
8614  goto __pyx_L15;
8615  }
8616 
8617  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":897
8618  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8619  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8620  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
8621  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8622  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8623  */
8624  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 897, __pyx_L1_error)
8625  __Pyx_GOTREF(__pyx_t_4);
8626  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 897, __pyx_L1_error)
8627  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8628  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 897, __pyx_L1_error)
8629  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8630  if (__pyx_t_6) {
8631  (__pyx_v_f[0]) = 90;
8632  (__pyx_v_f[1]) = 0x64;
8633  __pyx_v_f = (__pyx_v_f + 1);
8634  goto __pyx_L15;
8635  }
8636 
8637  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":898
8638  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8639  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8640  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
8641  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8642  * else:
8643  */
8644  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 898, __pyx_L1_error)
8645  __Pyx_GOTREF(__pyx_t_3);
8646  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 898, __pyx_L1_error)
8647  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8648  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 898, __pyx_L1_error)
8649  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8650  if (__pyx_t_6) {
8651  (__pyx_v_f[0]) = 90;
8652  (__pyx_v_f[1]) = 0x67;
8653  __pyx_v_f = (__pyx_v_f + 1);
8654  goto __pyx_L15;
8655  }
8656 
8657  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":899
8658  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8659  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8660  * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
8661  * else:
8662  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
8663  */
8664  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 899, __pyx_L1_error)
8665  __Pyx_GOTREF(__pyx_t_4);
8666  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 899, __pyx_L1_error)
8667  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8668  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 899, __pyx_L1_error)
8669  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8670  if (likely(__pyx_t_6)) {
8671  (__pyx_v_f[0]) = 79;
8672  goto __pyx_L15;
8673  }
8674 
8675  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":901
8676  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8677  * else:
8678  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
8679  * f += 1
8680  * else:
8681  */
8682  /*else*/ {
8683  __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 901, __pyx_L1_error)
8684  __Pyx_GOTREF(__pyx_t_3);
8685  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 901, __pyx_L1_error)
8686  __Pyx_GOTREF(__pyx_t_4);
8687  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8688  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8689  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8690  __PYX_ERR(2, 901, __pyx_L1_error)
8691  }
8692  __pyx_L15:;
8693 
8694  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":902
8695  * else:
8696  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
8697  * f += 1 # <<<<<<<<<<<<<<
8698  * else:
8699  * # Cython ignores struct boundary information ("T{...}"),
8700  */
8701  __pyx_v_f = (__pyx_v_f + 1);
8702 
8703  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
8704  * offset[0] += child.itemsize
8705  *
8706  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
8707  * t = child.type_num
8708  * if end - f < 5:
8709  */
8710  goto __pyx_L13;
8711  }
8712 
8713  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":906
8714  * # Cython ignores struct boundary information ("T{...}"),
8715  * # so don't output it
8716  * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
8717  * return f
8718  *
8719  */
8720  /*else*/ {
8721  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 906, __pyx_L1_error)
8722  __pyx_v_f = __pyx_t_9;
8723  }
8724  __pyx_L13:;
8725 
8726  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
8727  * cdef tuple fields
8728  *
8729  * for childname in descr.names: # <<<<<<<<<<<<<<
8730  * fields = descr.fields[childname]
8731  * child, new_offset = fields
8732  */
8733  }
8734  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8735 
8736  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":907
8737  * # so don't output it
8738  * f = _util_dtypestring(child, f, end, offset)
8739  * return f # <<<<<<<<<<<<<<
8740  *
8741  *
8742  */
8743  __pyx_r = __pyx_v_f;
8744  goto __pyx_L0;
8745 
8746  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
8747  * return ()
8748  *
8749  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
8750  * # Recursive utility function used in __getbuffer__ to get format
8751  * # string. The new location in the format string is returned.
8752  */
8753 
8754  /* function exit code */
8755  __pyx_L1_error:;
8756  __Pyx_XDECREF(__pyx_t_1);
8757  __Pyx_XDECREF(__pyx_t_3);
8758  __Pyx_XDECREF(__pyx_t_4);
8759  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
8760  __pyx_r = NULL;
8761  __pyx_L0:;
8762  __Pyx_XDECREF((PyObject *)__pyx_v_child);
8763  __Pyx_XDECREF(__pyx_v_fields);
8764  __Pyx_XDECREF(__pyx_v_childname);
8765  __Pyx_XDECREF(__pyx_v_new_offset);
8766  __Pyx_XDECREF(__pyx_v_t);
8767  __Pyx_RefNannyFinishContext();
8768  return __pyx_r;
8769 }
8770 
8771 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
8772  * int _import_umath() except -1
8773  *
8774  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
8775  * Py_INCREF(base) # important to do this before stealing the reference below!
8776  * PyArray_SetBaseObject(arr, base)
8777  */
8778 
8779 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
8780  __Pyx_RefNannyDeclarations
8781  __Pyx_RefNannySetupContext("set_array_base", 0);
8782 
8783  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1023
8784  *
8785  * cdef inline void set_array_base(ndarray arr, object base):
8786  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
8787  * PyArray_SetBaseObject(arr, base)
8788  *
8789  */
8790  Py_INCREF(__pyx_v_base);
8791 
8792  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1024
8793  * cdef inline void set_array_base(ndarray arr, object base):
8794  * Py_INCREF(base) # important to do this before stealing the reference below!
8795  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
8796  *
8797  * cdef inline object get_array_base(ndarray arr):
8798  */
8799  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
8800 
8801  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
8802  * int _import_umath() except -1
8803  *
8804  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
8805  * Py_INCREF(base) # important to do this before stealing the reference below!
8806  * PyArray_SetBaseObject(arr, base)
8807  */
8808 
8809  /* function exit code */
8810  __Pyx_RefNannyFinishContext();
8811 }
8812 
8813 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
8814  * PyArray_SetBaseObject(arr, base)
8815  *
8816  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
8817  * base = PyArray_BASE(arr)
8818  * if base is NULL:
8819  */
8820 
8821 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
8822  PyObject *__pyx_v_base;
8823  PyObject *__pyx_r = NULL;
8824  __Pyx_RefNannyDeclarations
8825  int __pyx_t_1;
8826  __Pyx_RefNannySetupContext("get_array_base", 0);
8827 
8828  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1027
8829  *
8830  * cdef inline object get_array_base(ndarray arr):
8831  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
8832  * if base is NULL:
8833  * return None
8834  */
8835  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
8836 
8837  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
8838  * cdef inline object get_array_base(ndarray arr):
8839  * base = PyArray_BASE(arr)
8840  * if base is NULL: # <<<<<<<<<<<<<<
8841  * return None
8842  * return <object>base
8843  */
8844  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
8845  if (__pyx_t_1) {
8846 
8847  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1029
8848  * base = PyArray_BASE(arr)
8849  * if base is NULL:
8850  * return None # <<<<<<<<<<<<<<
8851  * return <object>base
8852  *
8853  */
8854  __Pyx_XDECREF(__pyx_r);
8855  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8856  goto __pyx_L0;
8857 
8858  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
8859  * cdef inline object get_array_base(ndarray arr):
8860  * base = PyArray_BASE(arr)
8861  * if base is NULL: # <<<<<<<<<<<<<<
8862  * return None
8863  * return <object>base
8864  */
8865  }
8866 
8867  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1030
8868  * if base is NULL:
8869  * return None
8870  * return <object>base # <<<<<<<<<<<<<<
8871  *
8872  * # Versions of the import_* functions which are more suitable for
8873  */
8874  __Pyx_XDECREF(__pyx_r);
8875  __Pyx_INCREF(((PyObject *)__pyx_v_base));
8876  __pyx_r = ((PyObject *)__pyx_v_base);
8877  goto __pyx_L0;
8878 
8879  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
8880  * PyArray_SetBaseObject(arr, base)
8881  *
8882  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
8883  * base = PyArray_BASE(arr)
8884  * if base is NULL:
8885  */
8886 
8887  /* function exit code */
8888  __pyx_L0:;
8889  __Pyx_XGIVEREF(__pyx_r);
8890  __Pyx_RefNannyFinishContext();
8891  return __pyx_r;
8892 }
8893 
8894 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
8895  * # Versions of the import_* functions which are more suitable for
8896  * # Cython code.
8897  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8898  * try:
8899  * _import_array()
8900  */
8901 
8902 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
8903  int __pyx_r;
8904  __Pyx_RefNannyDeclarations
8905  PyObject *__pyx_t_1 = NULL;
8906  PyObject *__pyx_t_2 = NULL;
8907  PyObject *__pyx_t_3 = NULL;
8908  int __pyx_t_4;
8909  PyObject *__pyx_t_5 = NULL;
8910  PyObject *__pyx_t_6 = NULL;
8911  PyObject *__pyx_t_7 = NULL;
8912  PyObject *__pyx_t_8 = NULL;
8913  __Pyx_RefNannySetupContext("import_array", 0);
8914 
8915  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
8916  * # Cython code.
8917  * cdef inline int import_array() except -1:
8918  * try: # <<<<<<<<<<<<<<
8919  * _import_array()
8920  * except Exception:
8921  */
8922  {
8923  __Pyx_PyThreadState_declare
8924  __Pyx_PyThreadState_assign
8925  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8926  __Pyx_XGOTREF(__pyx_t_1);
8927  __Pyx_XGOTREF(__pyx_t_2);
8928  __Pyx_XGOTREF(__pyx_t_3);
8929  /*try:*/ {
8930 
8931  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1036
8932  * cdef inline int import_array() except -1:
8933  * try:
8934  * _import_array() # <<<<<<<<<<<<<<
8935  * except Exception:
8936  * raise ImportError("numpy.core.multiarray failed to import")
8937  */
8938  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1036, __pyx_L3_error)
8939 
8940  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
8941  * # Cython code.
8942  * cdef inline int import_array() except -1:
8943  * try: # <<<<<<<<<<<<<<
8944  * _import_array()
8945  * except Exception:
8946  */
8947  }
8948  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8949  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8950  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8951  goto __pyx_L8_try_end;
8952  __pyx_L3_error:;
8953 
8954  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1037
8955  * try:
8956  * _import_array()
8957  * except Exception: # <<<<<<<<<<<<<<
8958  * raise ImportError("numpy.core.multiarray failed to import")
8959  *
8960  */
8961  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8962  if (__pyx_t_4) {
8963  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8964  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1037, __pyx_L5_except_error)
8965  __Pyx_GOTREF(__pyx_t_5);
8966  __Pyx_GOTREF(__pyx_t_6);
8967  __Pyx_GOTREF(__pyx_t_7);
8968 
8969  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
8970  * _import_array()
8971  * except Exception:
8972  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
8973  *
8974  * cdef inline int import_umath() except -1:
8975  */
8976  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1038, __pyx_L5_except_error)
8977  __Pyx_GOTREF(__pyx_t_8);
8978  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8979  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8980  __PYX_ERR(2, 1038, __pyx_L5_except_error)
8981  }
8982  goto __pyx_L5_except_error;
8983  __pyx_L5_except_error:;
8984 
8985  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
8986  * # Cython code.
8987  * cdef inline int import_array() except -1:
8988  * try: # <<<<<<<<<<<<<<
8989  * _import_array()
8990  * except Exception:
8991  */
8992  __Pyx_XGIVEREF(__pyx_t_1);
8993  __Pyx_XGIVEREF(__pyx_t_2);
8994  __Pyx_XGIVEREF(__pyx_t_3);
8995  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8996  goto __pyx_L1_error;
8997  __pyx_L8_try_end:;
8998  }
8999 
9000  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
9001  * # Versions of the import_* functions which are more suitable for
9002  * # Cython code.
9003  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
9004  * try:
9005  * _import_array()
9006  */
9007 
9008  /* function exit code */
9009  __pyx_r = 0;
9010  goto __pyx_L0;
9011  __pyx_L1_error:;
9012  __Pyx_XDECREF(__pyx_t_5);
9013  __Pyx_XDECREF(__pyx_t_6);
9014  __Pyx_XDECREF(__pyx_t_7);
9015  __Pyx_XDECREF(__pyx_t_8);
9016  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
9017  __pyx_r = -1;
9018  __pyx_L0:;
9019  __Pyx_RefNannyFinishContext();
9020  return __pyx_r;
9021 }
9022 
9023 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
9024  * raise ImportError("numpy.core.multiarray failed to import")
9025  *
9026  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
9027  * try:
9028  * _import_umath()
9029  */
9030 
9031 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
9032  int __pyx_r;
9033  __Pyx_RefNannyDeclarations
9034  PyObject *__pyx_t_1 = NULL;
9035  PyObject *__pyx_t_2 = NULL;
9036  PyObject *__pyx_t_3 = NULL;
9037  int __pyx_t_4;
9038  PyObject *__pyx_t_5 = NULL;
9039  PyObject *__pyx_t_6 = NULL;
9040  PyObject *__pyx_t_7 = NULL;
9041  PyObject *__pyx_t_8 = NULL;
9042  __Pyx_RefNannySetupContext("import_umath", 0);
9043 
9044  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
9045  *
9046  * cdef inline int import_umath() except -1:
9047  * try: # <<<<<<<<<<<<<<
9048  * _import_umath()
9049  * except Exception:
9050  */
9051  {
9052  __Pyx_PyThreadState_declare
9053  __Pyx_PyThreadState_assign
9054  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9055  __Pyx_XGOTREF(__pyx_t_1);
9056  __Pyx_XGOTREF(__pyx_t_2);
9057  __Pyx_XGOTREF(__pyx_t_3);
9058  /*try:*/ {
9059 
9060  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1042
9061  * cdef inline int import_umath() except -1:
9062  * try:
9063  * _import_umath() # <<<<<<<<<<<<<<
9064  * except Exception:
9065  * raise ImportError("numpy.core.umath failed to import")
9066  */
9067  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1042, __pyx_L3_error)
9068 
9069  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
9070  *
9071  * cdef inline int import_umath() except -1:
9072  * try: # <<<<<<<<<<<<<<
9073  * _import_umath()
9074  * except Exception:
9075  */
9076  }
9077  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9078  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9079  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9080  goto __pyx_L8_try_end;
9081  __pyx_L3_error:;
9082 
9083  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1043
9084  * try:
9085  * _import_umath()
9086  * except Exception: # <<<<<<<<<<<<<<
9087  * raise ImportError("numpy.core.umath failed to import")
9088  *
9089  */
9090  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
9091  if (__pyx_t_4) {
9092  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
9093  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1043, __pyx_L5_except_error)
9094  __Pyx_GOTREF(__pyx_t_5);
9095  __Pyx_GOTREF(__pyx_t_6);
9096  __Pyx_GOTREF(__pyx_t_7);
9097 
9098  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
9099  * _import_umath()
9100  * except Exception:
9101  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
9102  *
9103  * cdef inline int import_ufunc() except -1:
9104  */
9105  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1044, __pyx_L5_except_error)
9106  __Pyx_GOTREF(__pyx_t_8);
9107  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
9108  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9109  __PYX_ERR(2, 1044, __pyx_L5_except_error)
9110  }
9111  goto __pyx_L5_except_error;
9112  __pyx_L5_except_error:;
9113 
9114  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
9115  *
9116  * cdef inline int import_umath() except -1:
9117  * try: # <<<<<<<<<<<<<<
9118  * _import_umath()
9119  * except Exception:
9120  */
9121  __Pyx_XGIVEREF(__pyx_t_1);
9122  __Pyx_XGIVEREF(__pyx_t_2);
9123  __Pyx_XGIVEREF(__pyx_t_3);
9124  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
9125  goto __pyx_L1_error;
9126  __pyx_L8_try_end:;
9127  }
9128 
9129  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
9130  * raise ImportError("numpy.core.multiarray failed to import")
9131  *
9132  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
9133  * try:
9134  * _import_umath()
9135  */
9136 
9137  /* function exit code */
9138  __pyx_r = 0;
9139  goto __pyx_L0;
9140  __pyx_L1_error:;
9141  __Pyx_XDECREF(__pyx_t_5);
9142  __Pyx_XDECREF(__pyx_t_6);
9143  __Pyx_XDECREF(__pyx_t_7);
9144  __Pyx_XDECREF(__pyx_t_8);
9145  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
9146  __pyx_r = -1;
9147  __pyx_L0:;
9148  __Pyx_RefNannyFinishContext();
9149  return __pyx_r;
9150 }
9151 
9152 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
9153  * raise ImportError("numpy.core.umath failed to import")
9154  *
9155  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
9156  * try:
9157  * _import_umath()
9158  */
9159 
9160 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
9161  int __pyx_r;
9162  __Pyx_RefNannyDeclarations
9163  PyObject *__pyx_t_1 = NULL;
9164  PyObject *__pyx_t_2 = NULL;
9165  PyObject *__pyx_t_3 = NULL;
9166  int __pyx_t_4;
9167  PyObject *__pyx_t_5 = NULL;
9168  PyObject *__pyx_t_6 = NULL;
9169  PyObject *__pyx_t_7 = NULL;
9170  PyObject *__pyx_t_8 = NULL;
9171  __Pyx_RefNannySetupContext("import_ufunc", 0);
9172 
9173  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
9174  *
9175  * cdef inline int import_ufunc() except -1:
9176  * try: # <<<<<<<<<<<<<<
9177  * _import_umath()
9178  * except Exception:
9179  */
9180  {
9181  __Pyx_PyThreadState_declare
9182  __Pyx_PyThreadState_assign
9183  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9184  __Pyx_XGOTREF(__pyx_t_1);
9185  __Pyx_XGOTREF(__pyx_t_2);
9186  __Pyx_XGOTREF(__pyx_t_3);
9187  /*try:*/ {
9188 
9189  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1048
9190  * cdef inline int import_ufunc() except -1:
9191  * try:
9192  * _import_umath() # <<<<<<<<<<<<<<
9193  * except Exception:
9194  * raise ImportError("numpy.core.umath failed to import")
9195  */
9196  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1048, __pyx_L3_error)
9197 
9198  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
9199  *
9200  * cdef inline int import_ufunc() except -1:
9201  * try: # <<<<<<<<<<<<<<
9202  * _import_umath()
9203  * except Exception:
9204  */
9205  }
9206  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9207  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9208  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9209  goto __pyx_L8_try_end;
9210  __pyx_L3_error:;
9211 
9212  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1049
9213  * try:
9214  * _import_umath()
9215  * except Exception: # <<<<<<<<<<<<<<
9216  * raise ImportError("numpy.core.umath failed to import")
9217  */
9218  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
9219  if (__pyx_t_4) {
9220  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
9221  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1049, __pyx_L5_except_error)
9222  __Pyx_GOTREF(__pyx_t_5);
9223  __Pyx_GOTREF(__pyx_t_6);
9224  __Pyx_GOTREF(__pyx_t_7);
9225 
9226  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1050
9227  * _import_umath()
9228  * except Exception:
9229  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
9230  */
9231  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1050, __pyx_L5_except_error)
9232  __Pyx_GOTREF(__pyx_t_8);
9233  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
9234  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9235  __PYX_ERR(2, 1050, __pyx_L5_except_error)
9236  }
9237  goto __pyx_L5_except_error;
9238  __pyx_L5_except_error:;
9239 
9240  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
9241  *
9242  * cdef inline int import_ufunc() except -1:
9243  * try: # <<<<<<<<<<<<<<
9244  * _import_umath()
9245  * except Exception:
9246  */
9247  __Pyx_XGIVEREF(__pyx_t_1);
9248  __Pyx_XGIVEREF(__pyx_t_2);
9249  __Pyx_XGIVEREF(__pyx_t_3);
9250  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
9251  goto __pyx_L1_error;
9252  __pyx_L8_try_end:;
9253  }
9254 
9255  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
9256  * raise ImportError("numpy.core.umath failed to import")
9257  *
9258  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
9259  * try:
9260  * _import_umath()
9261  */
9262 
9263  /* function exit code */
9264  __pyx_r = 0;
9265  goto __pyx_L0;
9266  __pyx_L1_error:;
9267  __Pyx_XDECREF(__pyx_t_5);
9268  __Pyx_XDECREF(__pyx_t_6);
9269  __Pyx_XDECREF(__pyx_t_7);
9270  __Pyx_XDECREF(__pyx_t_8);
9271  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
9272  __pyx_r = -1;
9273  __pyx_L0:;
9274  __Pyx_RefNannyFinishContext();
9275  return __pyx_r;
9276 }
9277 
9278 /* "View.MemoryView":122
9279  * cdef bint dtype_is_object
9280  *
9281  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9282  * mode="c", bint allocate_buffer=True):
9283  *
9284  */
9285 
9286 /* Python wrapper */
9287 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9288 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9289  PyObject *__pyx_v_shape = 0;
9290  Py_ssize_t __pyx_v_itemsize;
9291  PyObject *__pyx_v_format = 0;
9292  PyObject *__pyx_v_mode = 0;
9293  int __pyx_v_allocate_buffer;
9294  int __pyx_r;
9295  __Pyx_RefNannyDeclarations
9296  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
9297  {
9298  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
9299  PyObject* values[5] = {0,0,0,0,0};
9300  values[3] = ((PyObject *)__pyx_n_s_c);
9301  if (unlikely(__pyx_kwds)) {
9302  Py_ssize_t kw_args;
9303  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9304  switch (pos_args) {
9305  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9306  CYTHON_FALLTHROUGH;
9307  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9308  CYTHON_FALLTHROUGH;
9309  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9310  CYTHON_FALLTHROUGH;
9311  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9312  CYTHON_FALLTHROUGH;
9313  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9314  CYTHON_FALLTHROUGH;
9315  case 0: break;
9316  default: goto __pyx_L5_argtuple_error;
9317  }
9318  kw_args = PyDict_Size(__pyx_kwds);
9319  switch (pos_args) {
9320  case 0:
9321  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
9322  else goto __pyx_L5_argtuple_error;
9323  CYTHON_FALLTHROUGH;
9324  case 1:
9325  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
9326  else {
9327  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
9328  }
9329  CYTHON_FALLTHROUGH;
9330  case 2:
9331  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
9332  else {
9333  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
9334  }
9335  CYTHON_FALLTHROUGH;
9336  case 3:
9337  if (kw_args > 0) {
9338  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
9339  if (value) { values[3] = value; kw_args--; }
9340  }
9341  CYTHON_FALLTHROUGH;
9342  case 4:
9343  if (kw_args > 0) {
9344  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
9345  if (value) { values[4] = value; kw_args--; }
9346  }
9347  }
9348  if (unlikely(kw_args > 0)) {
9349  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
9350  }
9351  } else {
9352  switch (PyTuple_GET_SIZE(__pyx_args)) {
9353  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9354  CYTHON_FALLTHROUGH;
9355  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9356  CYTHON_FALLTHROUGH;
9357  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9358  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9359  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9360  break;
9361  default: goto __pyx_L5_argtuple_error;
9362  }
9363  }
9364  __pyx_v_shape = ((PyObject*)values[0]);
9365  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
9366  __pyx_v_format = values[2];
9367  __pyx_v_mode = values[3];
9368  if (values[4]) {
9369  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
9370  } else {
9371 
9372  /* "View.MemoryView":123
9373  *
9374  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
9375  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
9376  *
9377  * cdef int idx
9378  */
9379  __pyx_v_allocate_buffer = ((int)1);
9380  }
9381  }
9382  goto __pyx_L4_argument_unpacking_done;
9383  __pyx_L5_argtuple_error:;
9384  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
9385  __pyx_L3_error:;
9386  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9387  __Pyx_RefNannyFinishContext();
9388  return -1;
9389  __pyx_L4_argument_unpacking_done:;
9390  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
9391  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
9392  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
9393  }
9394  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
9395 
9396  /* "View.MemoryView":122
9397  * cdef bint dtype_is_object
9398  *
9399  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9400  * mode="c", bint allocate_buffer=True):
9401  *
9402  */
9403 
9404  /* function exit code */
9405  goto __pyx_L0;
9406  __pyx_L1_error:;
9407  __pyx_r = -1;
9408  __pyx_L0:;
9409  __Pyx_RefNannyFinishContext();
9410  return __pyx_r;
9411 }
9412 
9413 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
9414  int __pyx_v_idx;
9415  Py_ssize_t __pyx_v_i;
9416  Py_ssize_t __pyx_v_dim;
9417  PyObject **__pyx_v_p;
9418  char __pyx_v_order;
9419  int __pyx_r;
9420  __Pyx_RefNannyDeclarations
9421  Py_ssize_t __pyx_t_1;
9422  int __pyx_t_2;
9423  PyObject *__pyx_t_3 = NULL;
9424  int __pyx_t_4;
9425  PyObject *__pyx_t_5 = NULL;
9426  PyObject *__pyx_t_6 = NULL;
9427  char *__pyx_t_7;
9428  int __pyx_t_8;
9429  Py_ssize_t __pyx_t_9;
9430  PyObject *__pyx_t_10 = NULL;
9431  Py_ssize_t __pyx_t_11;
9432  __Pyx_RefNannySetupContext("__cinit__", 0);
9433  __Pyx_INCREF(__pyx_v_format);
9434 
9435  /* "View.MemoryView":129
9436  * cdef PyObject **p
9437  *
9438  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
9439  * self.itemsize = itemsize
9440  *
9441  */
9442  if (unlikely(__pyx_v_shape == Py_None)) {
9443  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
9444  __PYX_ERR(1, 129, __pyx_L1_error)
9445  }
9446  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
9447  __pyx_v_self->ndim = ((int)__pyx_t_1);
9448 
9449  /* "View.MemoryView":130
9450  *
9451  * self.ndim = <int> len(shape)
9452  * self.itemsize = itemsize # <<<<<<<<<<<<<<
9453  *
9454  * if not self.ndim:
9455  */
9456  __pyx_v_self->itemsize = __pyx_v_itemsize;
9457 
9458  /* "View.MemoryView":132
9459  * self.itemsize = itemsize
9460  *
9461  * if not self.ndim: # <<<<<<<<<<<<<<
9462  * raise ValueError("Empty shape tuple for cython.array")
9463  *
9464  */
9465  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
9466  if (unlikely(__pyx_t_2)) {
9467 
9468  /* "View.MemoryView":133
9469  *
9470  * if not self.ndim:
9471  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
9472  *
9473  * if itemsize <= 0:
9474  */
9475  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
9476  __Pyx_GOTREF(__pyx_t_3);
9477  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9478  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9479  __PYX_ERR(1, 133, __pyx_L1_error)
9480 
9481  /* "View.MemoryView":132
9482  * self.itemsize = itemsize
9483  *
9484  * if not self.ndim: # <<<<<<<<<<<<<<
9485  * raise ValueError("Empty shape tuple for cython.array")
9486  *
9487  */
9488  }
9489 
9490  /* "View.MemoryView":135
9491  * raise ValueError("Empty shape tuple for cython.array")
9492  *
9493  * if itemsize <= 0: # <<<<<<<<<<<<<<
9494  * raise ValueError("itemsize <= 0 for cython.array")
9495  *
9496  */
9497  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
9498  if (unlikely(__pyx_t_2)) {
9499 
9500  /* "View.MemoryView":136
9501  *
9502  * if itemsize <= 0:
9503  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
9504  *
9505  * if not isinstance(format, bytes):
9506  */
9507  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
9508  __Pyx_GOTREF(__pyx_t_3);
9509  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9510  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9511  __PYX_ERR(1, 136, __pyx_L1_error)
9512 
9513  /* "View.MemoryView":135
9514  * raise ValueError("Empty shape tuple for cython.array")
9515  *
9516  * if itemsize <= 0: # <<<<<<<<<<<<<<
9517  * raise ValueError("itemsize <= 0 for cython.array")
9518  *
9519  */
9520  }
9521 
9522  /* "View.MemoryView":138
9523  * raise ValueError("itemsize <= 0 for cython.array")
9524  *
9525  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
9526  * format = format.encode('ASCII')
9527  * self._format = format # keep a reference to the byte string
9528  */
9529  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
9530  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
9531  if (__pyx_t_4) {
9532 
9533  /* "View.MemoryView":139
9534  *
9535  * if not isinstance(format, bytes):
9536  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
9537  * self._format = format # keep a reference to the byte string
9538  * self.format = self._format
9539  */
9540  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
9541  __Pyx_GOTREF(__pyx_t_5);
9542  __pyx_t_6 = NULL;
9543  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
9544  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
9545  if (likely(__pyx_t_6)) {
9546  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9547  __Pyx_INCREF(__pyx_t_6);
9548  __Pyx_INCREF(function);
9549  __Pyx_DECREF_SET(__pyx_t_5, function);
9550  }
9551  }
9552  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
9553  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9554  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
9555  __Pyx_GOTREF(__pyx_t_3);
9556  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9557  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
9558  __pyx_t_3 = 0;
9559 
9560  /* "View.MemoryView":138
9561  * raise ValueError("itemsize <= 0 for cython.array")
9562  *
9563  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
9564  * format = format.encode('ASCII')
9565  * self._format = format # keep a reference to the byte string
9566  */
9567  }
9568 
9569  /* "View.MemoryView":140
9570  * if not isinstance(format, bytes):
9571  * format = format.encode('ASCII')
9572  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
9573  * self.format = self._format
9574  *
9575  */
9576  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
9577  __pyx_t_3 = __pyx_v_format;
9578  __Pyx_INCREF(__pyx_t_3);
9579  __Pyx_GIVEREF(__pyx_t_3);
9580  __Pyx_GOTREF(__pyx_v_self->_format);
9581  __Pyx_DECREF(__pyx_v_self->_format);
9582  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
9583  __pyx_t_3 = 0;
9584 
9585  /* "View.MemoryView":141
9586  * format = format.encode('ASCII')
9587  * self._format = format # keep a reference to the byte string
9588  * self.format = self._format # <<<<<<<<<<<<<<
9589  *
9590  *
9591  */
9592  if (unlikely(__pyx_v_self->_format == Py_None)) {
9593  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
9594  __PYX_ERR(1, 141, __pyx_L1_error)
9595  }
9596  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
9597  __pyx_v_self->format = __pyx_t_7;
9598 
9599  /* "View.MemoryView":144
9600  *
9601  *
9602  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
9603  * self._strides = self._shape + self.ndim
9604  *
9605  */
9606  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
9607 
9608  /* "View.MemoryView":145
9609  *
9610  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
9611  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
9612  *
9613  * if not self._shape:
9614  */
9615  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
9616 
9617  /* "View.MemoryView":147
9618  * self._strides = self._shape + self.ndim
9619  *
9620  * if not self._shape: # <<<<<<<<<<<<<<
9621  * raise MemoryError("unable to allocate shape and strides.")
9622  *
9623  */
9624  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
9625  if (unlikely(__pyx_t_4)) {
9626 
9627  /* "View.MemoryView":148
9628  *
9629  * if not self._shape:
9630  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
9631  *
9632  *
9633  */
9634  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
9635  __Pyx_GOTREF(__pyx_t_3);
9636  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9637  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9638  __PYX_ERR(1, 148, __pyx_L1_error)
9639 
9640  /* "View.MemoryView":147
9641  * self._strides = self._shape + self.ndim
9642  *
9643  * if not self._shape: # <<<<<<<<<<<<<<
9644  * raise MemoryError("unable to allocate shape and strides.")
9645  *
9646  */
9647  }
9648 
9649  /* "View.MemoryView":151
9650  *
9651  *
9652  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
9653  * if dim <= 0:
9654  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9655  */
9656  __pyx_t_8 = 0;
9657  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
9658  for (;;) {
9659  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
9660  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9661  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
9662  #else
9663  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
9664  __Pyx_GOTREF(__pyx_t_5);
9665  #endif
9666  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
9667  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9668  __pyx_v_dim = __pyx_t_9;
9669  __pyx_v_idx = __pyx_t_8;
9670  __pyx_t_8 = (__pyx_t_8 + 1);
9671 
9672  /* "View.MemoryView":152
9673  *
9674  * for idx, dim in enumerate(shape):
9675  * if dim <= 0: # <<<<<<<<<<<<<<
9676  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9677  * self._shape[idx] = dim
9678  */
9679  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
9680  if (unlikely(__pyx_t_4)) {
9681 
9682  /* "View.MemoryView":153
9683  * for idx, dim in enumerate(shape):
9684  * if dim <= 0:
9685  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
9686  * self._shape[idx] = dim
9687  *
9688  */
9689  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
9690  __Pyx_GOTREF(__pyx_t_5);
9691  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
9692  __Pyx_GOTREF(__pyx_t_6);
9693  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
9694  __Pyx_GOTREF(__pyx_t_10);
9695  __Pyx_GIVEREF(__pyx_t_5);
9696  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
9697  __Pyx_GIVEREF(__pyx_t_6);
9698  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
9699  __pyx_t_5 = 0;
9700  __pyx_t_6 = 0;
9701  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
9702  __Pyx_GOTREF(__pyx_t_6);
9703  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9704  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
9705  __Pyx_GOTREF(__pyx_t_10);
9706  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9707  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9708  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9709  __PYX_ERR(1, 153, __pyx_L1_error)
9710 
9711  /* "View.MemoryView":152
9712  *
9713  * for idx, dim in enumerate(shape):
9714  * if dim <= 0: # <<<<<<<<<<<<<<
9715  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9716  * self._shape[idx] = dim
9717  */
9718  }
9719 
9720  /* "View.MemoryView":154
9721  * if dim <= 0:
9722  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9723  * self._shape[idx] = dim # <<<<<<<<<<<<<<
9724  *
9725  * cdef char order
9726  */
9727  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
9728 
9729  /* "View.MemoryView":151
9730  *
9731  *
9732  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
9733  * if dim <= 0:
9734  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9735  */
9736  }
9737  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9738 
9739  /* "View.MemoryView":157
9740  *
9741  * cdef char order
9742  * if mode == 'fortran': # <<<<<<<<<<<<<<
9743  * order = b'F'
9744  * self.mode = u'fortran'
9745  */
9746  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
9747  if (__pyx_t_4) {
9748 
9749  /* "View.MemoryView":158
9750  * cdef char order
9751  * if mode == 'fortran':
9752  * order = b'F' # <<<<<<<<<<<<<<
9753  * self.mode = u'fortran'
9754  * elif mode == 'c':
9755  */
9756  __pyx_v_order = 'F';
9757 
9758  /* "View.MemoryView":159
9759  * if mode == 'fortran':
9760  * order = b'F'
9761  * self.mode = u'fortran' # <<<<<<<<<<<<<<
9762  * elif mode == 'c':
9763  * order = b'C'
9764  */
9765  __Pyx_INCREF(__pyx_n_u_fortran);
9766  __Pyx_GIVEREF(__pyx_n_u_fortran);
9767  __Pyx_GOTREF(__pyx_v_self->mode);
9768  __Pyx_DECREF(__pyx_v_self->mode);
9769  __pyx_v_self->mode = __pyx_n_u_fortran;
9770 
9771  /* "View.MemoryView":157
9772  *
9773  * cdef char order
9774  * if mode == 'fortran': # <<<<<<<<<<<<<<
9775  * order = b'F'
9776  * self.mode = u'fortran'
9777  */
9778  goto __pyx_L10;
9779  }
9780 
9781  /* "View.MemoryView":160
9782  * order = b'F'
9783  * self.mode = u'fortran'
9784  * elif mode == 'c': # <<<<<<<<<<<<<<
9785  * order = b'C'
9786  * self.mode = u'c'
9787  */
9788  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
9789  if (likely(__pyx_t_4)) {
9790 
9791  /* "View.MemoryView":161
9792  * self.mode = u'fortran'
9793  * elif mode == 'c':
9794  * order = b'C' # <<<<<<<<<<<<<<
9795  * self.mode = u'c'
9796  * else:
9797  */
9798  __pyx_v_order = 'C';
9799 
9800  /* "View.MemoryView":162
9801  * elif mode == 'c':
9802  * order = b'C'
9803  * self.mode = u'c' # <<<<<<<<<<<<<<
9804  * else:
9805  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
9806  */
9807  __Pyx_INCREF(__pyx_n_u_c);
9808  __Pyx_GIVEREF(__pyx_n_u_c);
9809  __Pyx_GOTREF(__pyx_v_self->mode);
9810  __Pyx_DECREF(__pyx_v_self->mode);
9811  __pyx_v_self->mode = __pyx_n_u_c;
9812 
9813  /* "View.MemoryView":160
9814  * order = b'F'
9815  * self.mode = u'fortran'
9816  * elif mode == 'c': # <<<<<<<<<<<<<<
9817  * order = b'C'
9818  * self.mode = u'c'
9819  */
9820  goto __pyx_L10;
9821  }
9822 
9823  /* "View.MemoryView":164
9824  * self.mode = u'c'
9825  * else:
9826  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
9827  *
9828  * self.len = fill_contig_strides_array(self._shape, self._strides,
9829  */
9830  /*else*/ {
9831  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
9832  __Pyx_GOTREF(__pyx_t_3);
9833  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
9834  __Pyx_GOTREF(__pyx_t_10);
9835  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9836  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9837  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9838  __PYX_ERR(1, 164, __pyx_L1_error)
9839  }
9840  __pyx_L10:;
9841 
9842  /* "View.MemoryView":166
9843  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
9844  *
9845  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
9846  * itemsize, self.ndim, order)
9847  *
9848  */
9849  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
9850 
9851  /* "View.MemoryView":169
9852  * itemsize, self.ndim, order)
9853  *
9854  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
9855  * self.dtype_is_object = format == b'O'
9856  * if allocate_buffer:
9857  */
9858  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
9859 
9860  /* "View.MemoryView":170
9861  *
9862  * self.free_data = allocate_buffer
9863  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
9864  * if allocate_buffer:
9865  *
9866  */
9867  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
9868  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
9869  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9870  __pyx_v_self->dtype_is_object = __pyx_t_4;
9871 
9872  /* "View.MemoryView":171
9873  * self.free_data = allocate_buffer
9874  * self.dtype_is_object = format == b'O'
9875  * if allocate_buffer: # <<<<<<<<<<<<<<
9876  *
9877  *
9878  */
9879  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
9880  if (__pyx_t_4) {
9881 
9882  /* "View.MemoryView":174
9883  *
9884  *
9885  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
9886  * if not self.data:
9887  * raise MemoryError("unable to allocate array data.")
9888  */
9889  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
9890 
9891  /* "View.MemoryView":175
9892  *
9893  * self.data = <char *>malloc(self.len)
9894  * if not self.data: # <<<<<<<<<<<<<<
9895  * raise MemoryError("unable to allocate array data.")
9896  *
9897  */
9898  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
9899  if (unlikely(__pyx_t_4)) {
9900 
9901  /* "View.MemoryView":176
9902  * self.data = <char *>malloc(self.len)
9903  * if not self.data:
9904  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
9905  *
9906  * if self.dtype_is_object:
9907  */
9908  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
9909  __Pyx_GOTREF(__pyx_t_10);
9910  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9911  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9912  __PYX_ERR(1, 176, __pyx_L1_error)
9913 
9914  /* "View.MemoryView":175
9915  *
9916  * self.data = <char *>malloc(self.len)
9917  * if not self.data: # <<<<<<<<<<<<<<
9918  * raise MemoryError("unable to allocate array data.")
9919  *
9920  */
9921  }
9922 
9923  /* "View.MemoryView":178
9924  * raise MemoryError("unable to allocate array data.")
9925  *
9926  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9927  * p = <PyObject **> self.data
9928  * for i in range(self.len / itemsize):
9929  */
9930  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
9931  if (__pyx_t_4) {
9932 
9933  /* "View.MemoryView":179
9934  *
9935  * if self.dtype_is_object:
9936  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
9937  * for i in range(self.len / itemsize):
9938  * p[i] = Py_None
9939  */
9940  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
9941 
9942  /* "View.MemoryView":180
9943  * if self.dtype_is_object:
9944  * p = <PyObject **> self.data
9945  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
9946  * p[i] = Py_None
9947  * Py_INCREF(Py_None)
9948  */
9949  if (unlikely(__pyx_v_itemsize == 0)) {
9950  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
9951  __PYX_ERR(1, 180, __pyx_L1_error)
9952  }
9953  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
9954  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
9955  __PYX_ERR(1, 180, __pyx_L1_error)
9956  }
9957  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
9958  __pyx_t_9 = __pyx_t_1;
9959  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
9960  __pyx_v_i = __pyx_t_11;
9961 
9962  /* "View.MemoryView":181
9963  * p = <PyObject **> self.data
9964  * for i in range(self.len / itemsize):
9965  * p[i] = Py_None # <<<<<<<<<<<<<<
9966  * Py_INCREF(Py_None)
9967  *
9968  */
9969  (__pyx_v_p[__pyx_v_i]) = Py_None;
9970 
9971  /* "View.MemoryView":182
9972  * for i in range(self.len / itemsize):
9973  * p[i] = Py_None
9974  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
9975  *
9976  * @cname('getbuffer')
9977  */
9978  Py_INCREF(Py_None);
9979  }
9980 
9981  /* "View.MemoryView":178
9982  * raise MemoryError("unable to allocate array data.")
9983  *
9984  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9985  * p = <PyObject **> self.data
9986  * for i in range(self.len / itemsize):
9987  */
9988  }
9989 
9990  /* "View.MemoryView":171
9991  * self.free_data = allocate_buffer
9992  * self.dtype_is_object = format == b'O'
9993  * if allocate_buffer: # <<<<<<<<<<<<<<
9994  *
9995  *
9996  */
9997  }
9998 
9999  /* "View.MemoryView":122
10000  * cdef bint dtype_is_object
10001  *
10002  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
10003  * mode="c", bint allocate_buffer=True):
10004  *
10005  */
10006 
10007  /* function exit code */
10008  __pyx_r = 0;
10009  goto __pyx_L0;
10010  __pyx_L1_error:;
10011  __Pyx_XDECREF(__pyx_t_3);
10012  __Pyx_XDECREF(__pyx_t_5);
10013  __Pyx_XDECREF(__pyx_t_6);
10014  __Pyx_XDECREF(__pyx_t_10);
10015  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10016  __pyx_r = -1;
10017  __pyx_L0:;
10018  __Pyx_XDECREF(__pyx_v_format);
10019  __Pyx_RefNannyFinishContext();
10020  return __pyx_r;
10021 }
10022 
10023 /* "View.MemoryView":185
10024  *
10025  * @cname('getbuffer')
10026  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
10027  * cdef int bufmode = -1
10028  * if self.mode == u"c":
10029  */
10030 
10031 /* Python wrapper */
10032 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
10033 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10034  int __pyx_r;
10035  __Pyx_RefNannyDeclarations
10036  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
10037  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
10038 
10039  /* function exit code */
10040  __Pyx_RefNannyFinishContext();
10041  return __pyx_r;
10042 }
10043 
10044 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10045  int __pyx_v_bufmode;
10046  int __pyx_r;
10047  __Pyx_RefNannyDeclarations
10048  int __pyx_t_1;
10049  int __pyx_t_2;
10050  PyObject *__pyx_t_3 = NULL;
10051  char *__pyx_t_4;
10052  Py_ssize_t __pyx_t_5;
10053  int __pyx_t_6;
10054  Py_ssize_t *__pyx_t_7;
10055  if (__pyx_v_info == NULL) {
10056  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
10057  return -1;
10058  }
10059  __Pyx_RefNannySetupContext("__getbuffer__", 0);
10060  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10061  __Pyx_GIVEREF(__pyx_v_info->obj);
10062 
10063  /* "View.MemoryView":186
10064  * @cname('getbuffer')
10065  * def __getbuffer__(self, Py_buffer *info, int flags):
10066  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
10067  * if self.mode == u"c":
10068  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10069  */
10070  __pyx_v_bufmode = -1;
10071 
10072  /* "View.MemoryView":187
10073  * def __getbuffer__(self, Py_buffer *info, int flags):
10074  * cdef int bufmode = -1
10075  * if self.mode == u"c": # <<<<<<<<<<<<<<
10076  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10077  * elif self.mode == u"fortran":
10078  */
10079  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
10080  __pyx_t_2 = (__pyx_t_1 != 0);
10081  if (__pyx_t_2) {
10082 
10083  /* "View.MemoryView":188
10084  * cdef int bufmode = -1
10085  * if self.mode == u"c":
10086  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
10087  * elif self.mode == u"fortran":
10088  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10089  */
10090  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
10091 
10092  /* "View.MemoryView":187
10093  * def __getbuffer__(self, Py_buffer *info, int flags):
10094  * cdef int bufmode = -1
10095  * if self.mode == u"c": # <<<<<<<<<<<<<<
10096  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10097  * elif self.mode == u"fortran":
10098  */
10099  goto __pyx_L3;
10100  }
10101 
10102  /* "View.MemoryView":189
10103  * if self.mode == u"c":
10104  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10105  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
10106  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10107  * if not (flags & bufmode):
10108  */
10109  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
10110  __pyx_t_1 = (__pyx_t_2 != 0);
10111  if (__pyx_t_1) {
10112 
10113  /* "View.MemoryView":190
10114  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10115  * elif self.mode == u"fortran":
10116  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
10117  * if not (flags & bufmode):
10118  * raise ValueError("Can only create a buffer that is contiguous in memory.")
10119  */
10120  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
10121 
10122  /* "View.MemoryView":189
10123  * if self.mode == u"c":
10124  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10125  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
10126  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10127  * if not (flags & bufmode):
10128  */
10129  }
10130  __pyx_L3:;
10131 
10132  /* "View.MemoryView":191
10133  * elif self.mode == u"fortran":
10134  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10135  * if not (flags & bufmode): # <<<<<<<<<<<<<<
10136  * raise ValueError("Can only create a buffer that is contiguous in memory.")
10137  * info.buf = self.data
10138  */
10139  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
10140  if (unlikely(__pyx_t_1)) {
10141 
10142  /* "View.MemoryView":192
10143  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10144  * if not (flags & bufmode):
10145  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
10146  * info.buf = self.data
10147  * info.len = self.len
10148  */
10149  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
10150  __Pyx_GOTREF(__pyx_t_3);
10151  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10152  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10153  __PYX_ERR(1, 192, __pyx_L1_error)
10154 
10155  /* "View.MemoryView":191
10156  * elif self.mode == u"fortran":
10157  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10158  * if not (flags & bufmode): # <<<<<<<<<<<<<<
10159  * raise ValueError("Can only create a buffer that is contiguous in memory.")
10160  * info.buf = self.data
10161  */
10162  }
10163 
10164  /* "View.MemoryView":193
10165  * if not (flags & bufmode):
10166  * raise ValueError("Can only create a buffer that is contiguous in memory.")
10167  * info.buf = self.data # <<<<<<<<<<<<<<
10168  * info.len = self.len
10169  * info.ndim = self.ndim
10170  */
10171  __pyx_t_4 = __pyx_v_self->data;
10172  __pyx_v_info->buf = __pyx_t_4;
10173 
10174  /* "View.MemoryView":194
10175  * raise ValueError("Can only create a buffer that is contiguous in memory.")
10176  * info.buf = self.data
10177  * info.len = self.len # <<<<<<<<<<<<<<
10178  * info.ndim = self.ndim
10179  * info.shape = self._shape
10180  */
10181  __pyx_t_5 = __pyx_v_self->len;
10182  __pyx_v_info->len = __pyx_t_5;
10183 
10184  /* "View.MemoryView":195
10185  * info.buf = self.data
10186  * info.len = self.len
10187  * info.ndim = self.ndim # <<<<<<<<<<<<<<
10188  * info.shape = self._shape
10189  * info.strides = self._strides
10190  */
10191  __pyx_t_6 = __pyx_v_self->ndim;
10192  __pyx_v_info->ndim = __pyx_t_6;
10193 
10194  /* "View.MemoryView":196
10195  * info.len = self.len
10196  * info.ndim = self.ndim
10197  * info.shape = self._shape # <<<<<<<<<<<<<<
10198  * info.strides = self._strides
10199  * info.suboffsets = NULL
10200  */
10201  __pyx_t_7 = __pyx_v_self->_shape;
10202  __pyx_v_info->shape = __pyx_t_7;
10203 
10204  /* "View.MemoryView":197
10205  * info.ndim = self.ndim
10206  * info.shape = self._shape
10207  * info.strides = self._strides # <<<<<<<<<<<<<<
10208  * info.suboffsets = NULL
10209  * info.itemsize = self.itemsize
10210  */
10211  __pyx_t_7 = __pyx_v_self->_strides;
10212  __pyx_v_info->strides = __pyx_t_7;
10213 
10214  /* "View.MemoryView":198
10215  * info.shape = self._shape
10216  * info.strides = self._strides
10217  * info.suboffsets = NULL # <<<<<<<<<<<<<<
10218  * info.itemsize = self.itemsize
10219  * info.readonly = 0
10220  */
10221  __pyx_v_info->suboffsets = NULL;
10222 
10223  /* "View.MemoryView":199
10224  * info.strides = self._strides
10225  * info.suboffsets = NULL
10226  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
10227  * info.readonly = 0
10228  *
10229  */
10230  __pyx_t_5 = __pyx_v_self->itemsize;
10231  __pyx_v_info->itemsize = __pyx_t_5;
10232 
10233  /* "View.MemoryView":200
10234  * info.suboffsets = NULL
10235  * info.itemsize = self.itemsize
10236  * info.readonly = 0 # <<<<<<<<<<<<<<
10237  *
10238  * if flags & PyBUF_FORMAT:
10239  */
10240  __pyx_v_info->readonly = 0;
10241 
10242  /* "View.MemoryView":202
10243  * info.readonly = 0
10244  *
10245  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10246  * info.format = self.format
10247  * else:
10248  */
10249  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10250  if (__pyx_t_1) {
10251 
10252  /* "View.MemoryView":203
10253  *
10254  * if flags & PyBUF_FORMAT:
10255  * info.format = self.format # <<<<<<<<<<<<<<
10256  * else:
10257  * info.format = NULL
10258  */
10259  __pyx_t_4 = __pyx_v_self->format;
10260  __pyx_v_info->format = __pyx_t_4;
10261 
10262  /* "View.MemoryView":202
10263  * info.readonly = 0
10264  *
10265  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10266  * info.format = self.format
10267  * else:
10268  */
10269  goto __pyx_L5;
10270  }
10271 
10272  /* "View.MemoryView":205
10273  * info.format = self.format
10274  * else:
10275  * info.format = NULL # <<<<<<<<<<<<<<
10276  *
10277  * info.obj = self
10278  */
10279  /*else*/ {
10280  __pyx_v_info->format = NULL;
10281  }
10282  __pyx_L5:;
10283 
10284  /* "View.MemoryView":207
10285  * info.format = NULL
10286  *
10287  * info.obj = self # <<<<<<<<<<<<<<
10288  *
10289  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
10290  */
10291  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10292  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10293  __Pyx_GOTREF(__pyx_v_info->obj);
10294  __Pyx_DECREF(__pyx_v_info->obj);
10295  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10296 
10297  /* "View.MemoryView":185
10298  *
10299  * @cname('getbuffer')
10300  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
10301  * cdef int bufmode = -1
10302  * if self.mode == u"c":
10303  */
10304 
10305  /* function exit code */
10306  __pyx_r = 0;
10307  goto __pyx_L0;
10308  __pyx_L1_error:;
10309  __Pyx_XDECREF(__pyx_t_3);
10310  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10311  __pyx_r = -1;
10312  if (__pyx_v_info->obj != NULL) {
10313  __Pyx_GOTREF(__pyx_v_info->obj);
10314  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10315  }
10316  goto __pyx_L2;
10317  __pyx_L0:;
10318  if (__pyx_v_info->obj == Py_None) {
10319  __Pyx_GOTREF(__pyx_v_info->obj);
10320  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10321  }
10322  __pyx_L2:;
10323  __Pyx_RefNannyFinishContext();
10324  return __pyx_r;
10325 }
10326 
10327 /* "View.MemoryView":211
10328  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
10329  *
10330  * def __dealloc__(array self): # <<<<<<<<<<<<<<
10331  * if self.callback_free_data != NULL:
10332  * self.callback_free_data(self.data)
10333  */
10334 
10335 /* Python wrapper */
10336 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
10337 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
10338  __Pyx_RefNannyDeclarations
10339  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10340  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
10341 
10342  /* function exit code */
10343  __Pyx_RefNannyFinishContext();
10344 }
10345 
10346 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
10347  __Pyx_RefNannyDeclarations
10348  int __pyx_t_1;
10349  __Pyx_RefNannySetupContext("__dealloc__", 0);
10350 
10351  /* "View.MemoryView":212
10352  *
10353  * def __dealloc__(array self):
10354  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
10355  * self.callback_free_data(self.data)
10356  * elif self.free_data:
10357  */
10358  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
10359  if (__pyx_t_1) {
10360 
10361  /* "View.MemoryView":213
10362  * def __dealloc__(array self):
10363  * if self.callback_free_data != NULL:
10364  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
10365  * elif self.free_data:
10366  * if self.dtype_is_object:
10367  */
10368  __pyx_v_self->callback_free_data(__pyx_v_self->data);
10369 
10370  /* "View.MemoryView":212
10371  *
10372  * def __dealloc__(array self):
10373  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
10374  * self.callback_free_data(self.data)
10375  * elif self.free_data:
10376  */
10377  goto __pyx_L3;
10378  }
10379 
10380  /* "View.MemoryView":214
10381  * if self.callback_free_data != NULL:
10382  * self.callback_free_data(self.data)
10383  * elif self.free_data: # <<<<<<<<<<<<<<
10384  * if self.dtype_is_object:
10385  * refcount_objects_in_slice(self.data, self._shape,
10386  */
10387  __pyx_t_1 = (__pyx_v_self->free_data != 0);
10388  if (__pyx_t_1) {
10389 
10390  /* "View.MemoryView":215
10391  * self.callback_free_data(self.data)
10392  * elif self.free_data:
10393  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10394  * refcount_objects_in_slice(self.data, self._shape,
10395  * self._strides, self.ndim, False)
10396  */
10397  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
10398  if (__pyx_t_1) {
10399 
10400  /* "View.MemoryView":216
10401  * elif self.free_data:
10402  * if self.dtype_is_object:
10403  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
10404  * self._strides, self.ndim, False)
10405  * free(self.data)
10406  */
10407  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
10408 
10409  /* "View.MemoryView":215
10410  * self.callback_free_data(self.data)
10411  * elif self.free_data:
10412  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10413  * refcount_objects_in_slice(self.data, self._shape,
10414  * self._strides, self.ndim, False)
10415  */
10416  }
10417 
10418  /* "View.MemoryView":218
10419  * refcount_objects_in_slice(self.data, self._shape,
10420  * self._strides, self.ndim, False)
10421  * free(self.data) # <<<<<<<<<<<<<<
10422  * PyObject_Free(self._shape)
10423  *
10424  */
10425  free(__pyx_v_self->data);
10426 
10427  /* "View.MemoryView":214
10428  * if self.callback_free_data != NULL:
10429  * self.callback_free_data(self.data)
10430  * elif self.free_data: # <<<<<<<<<<<<<<
10431  * if self.dtype_is_object:
10432  * refcount_objects_in_slice(self.data, self._shape,
10433  */
10434  }
10435  __pyx_L3:;
10436 
10437  /* "View.MemoryView":219
10438  * self._strides, self.ndim, False)
10439  * free(self.data)
10440  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
10441  *
10442  * @property
10443  */
10444  PyObject_Free(__pyx_v_self->_shape);
10445 
10446  /* "View.MemoryView":211
10447  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
10448  *
10449  * def __dealloc__(array self): # <<<<<<<<<<<<<<
10450  * if self.callback_free_data != NULL:
10451  * self.callback_free_data(self.data)
10452  */
10453 
10454  /* function exit code */
10455  __Pyx_RefNannyFinishContext();
10456 }
10457 
10458 /* "View.MemoryView":222
10459  *
10460  * @property
10461  * def memview(self): # <<<<<<<<<<<<<<
10462  * return self.get_memview()
10463  *
10464  */
10465 
10466 /* Python wrapper */
10467 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
10468 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
10469  PyObject *__pyx_r = 0;
10470  __Pyx_RefNannyDeclarations
10471  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10472  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
10473 
10474  /* function exit code */
10475  __Pyx_RefNannyFinishContext();
10476  return __pyx_r;
10477 }
10478 
10479 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
10480  PyObject *__pyx_r = NULL;
10481  __Pyx_RefNannyDeclarations
10482  PyObject *__pyx_t_1 = NULL;
10483  __Pyx_RefNannySetupContext("__get__", 0);
10484 
10485  /* "View.MemoryView":223
10486  * @property
10487  * def memview(self):
10488  * return self.get_memview() # <<<<<<<<<<<<<<
10489  *
10490  * @cname('get_memview')
10491  */
10492  __Pyx_XDECREF(__pyx_r);
10493  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
10494  __Pyx_GOTREF(__pyx_t_1);
10495  __pyx_r = __pyx_t_1;
10496  __pyx_t_1 = 0;
10497  goto __pyx_L0;
10498 
10499  /* "View.MemoryView":222
10500  *
10501  * @property
10502  * def memview(self): # <<<<<<<<<<<<<<
10503  * return self.get_memview()
10504  *
10505  */
10506 
10507  /* function exit code */
10508  __pyx_L1_error:;
10509  __Pyx_XDECREF(__pyx_t_1);
10510  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10511  __pyx_r = NULL;
10512  __pyx_L0:;
10513  __Pyx_XGIVEREF(__pyx_r);
10514  __Pyx_RefNannyFinishContext();
10515  return __pyx_r;
10516 }
10517 
10518 /* "View.MemoryView":226
10519  *
10520  * @cname('get_memview')
10521  * cdef get_memview(self): # <<<<<<<<<<<<<<
10522  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
10523  * return memoryview(self, flags, self.dtype_is_object)
10524  */
10525 
10526 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
10527  int __pyx_v_flags;
10528  PyObject *__pyx_r = NULL;
10529  __Pyx_RefNannyDeclarations
10530  PyObject *__pyx_t_1 = NULL;
10531  PyObject *__pyx_t_2 = NULL;
10532  PyObject *__pyx_t_3 = NULL;
10533  __Pyx_RefNannySetupContext("get_memview", 0);
10534 
10535  /* "View.MemoryView":227
10536  * @cname('get_memview')
10537  * cdef get_memview(self):
10538  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
10539  * return memoryview(self, flags, self.dtype_is_object)
10540  *
10541  */
10542  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
10543 
10544  /* "View.MemoryView":228
10545  * cdef get_memview(self):
10546  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
10547  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
10548  *
10549  * def __len__(self):
10550  */
10551  __Pyx_XDECREF(__pyx_r);
10552  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
10553  __Pyx_GOTREF(__pyx_t_1);
10554  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
10555  __Pyx_GOTREF(__pyx_t_2);
10556  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
10557  __Pyx_GOTREF(__pyx_t_3);
10558  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10559  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10560  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
10561  __Pyx_GIVEREF(__pyx_t_1);
10562  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
10563  __Pyx_GIVEREF(__pyx_t_2);
10564  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
10565  __pyx_t_1 = 0;
10566  __pyx_t_2 = 0;
10567  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
10568  __Pyx_GOTREF(__pyx_t_2);
10569  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10570  __pyx_r = __pyx_t_2;
10571  __pyx_t_2 = 0;
10572  goto __pyx_L0;
10573 
10574  /* "View.MemoryView":226
10575  *
10576  * @cname('get_memview')
10577  * cdef get_memview(self): # <<<<<<<<<<<<<<
10578  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
10579  * return memoryview(self, flags, self.dtype_is_object)
10580  */
10581 
10582  /* function exit code */
10583  __pyx_L1_error:;
10584  __Pyx_XDECREF(__pyx_t_1);
10585  __Pyx_XDECREF(__pyx_t_2);
10586  __Pyx_XDECREF(__pyx_t_3);
10587  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
10588  __pyx_r = 0;
10589  __pyx_L0:;
10590  __Pyx_XGIVEREF(__pyx_r);
10591  __Pyx_RefNannyFinishContext();
10592  return __pyx_r;
10593 }
10594 
10595 /* "View.MemoryView":230
10596  * return memoryview(self, flags, self.dtype_is_object)
10597  *
10598  * def __len__(self): # <<<<<<<<<<<<<<
10599  * return self._shape[0]
10600  *
10601  */
10602 
10603 /* Python wrapper */
10604 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
10605 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
10606  Py_ssize_t __pyx_r;
10607  __Pyx_RefNannyDeclarations
10608  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
10609  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
10610 
10611  /* function exit code */
10612  __Pyx_RefNannyFinishContext();
10613  return __pyx_r;
10614 }
10615 
10616 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
10617  Py_ssize_t __pyx_r;
10618  __Pyx_RefNannyDeclarations
10619  __Pyx_RefNannySetupContext("__len__", 0);
10620 
10621  /* "View.MemoryView":231
10622  *
10623  * def __len__(self):
10624  * return self._shape[0] # <<<<<<<<<<<<<<
10625  *
10626  * def __getattr__(self, attr):
10627  */
10628  __pyx_r = (__pyx_v_self->_shape[0]);
10629  goto __pyx_L0;
10630 
10631  /* "View.MemoryView":230
10632  * return memoryview(self, flags, self.dtype_is_object)
10633  *
10634  * def __len__(self): # <<<<<<<<<<<<<<
10635  * return self._shape[0]
10636  *
10637  */
10638 
10639  /* function exit code */
10640  __pyx_L0:;
10641  __Pyx_RefNannyFinishContext();
10642  return __pyx_r;
10643 }
10644 
10645 /* "View.MemoryView":233
10646  * return self._shape[0]
10647  *
10648  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
10649  * return getattr(self.memview, attr)
10650  *
10651  */
10652 
10653 /* Python wrapper */
10654 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
10655 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
10656  PyObject *__pyx_r = 0;
10657  __Pyx_RefNannyDeclarations
10658  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
10659  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
10660 
10661  /* function exit code */
10662  __Pyx_RefNannyFinishContext();
10663  return __pyx_r;
10664 }
10665 
10666 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
10667  PyObject *__pyx_r = NULL;
10668  __Pyx_RefNannyDeclarations
10669  PyObject *__pyx_t_1 = NULL;
10670  PyObject *__pyx_t_2 = NULL;
10671  __Pyx_RefNannySetupContext("__getattr__", 0);
10672 
10673  /* "View.MemoryView":234
10674  *
10675  * def __getattr__(self, attr):
10676  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
10677  *
10678  * def __getitem__(self, item):
10679  */
10680  __Pyx_XDECREF(__pyx_r);
10681  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
10682  __Pyx_GOTREF(__pyx_t_1);
10683  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
10684  __Pyx_GOTREF(__pyx_t_2);
10685  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10686  __pyx_r = __pyx_t_2;
10687  __pyx_t_2 = 0;
10688  goto __pyx_L0;
10689 
10690  /* "View.MemoryView":233
10691  * return self._shape[0]
10692  *
10693  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
10694  * return getattr(self.memview, attr)
10695  *
10696  */
10697 
10698  /* function exit code */
10699  __pyx_L1_error:;
10700  __Pyx_XDECREF(__pyx_t_1);
10701  __Pyx_XDECREF(__pyx_t_2);
10702  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10703  __pyx_r = NULL;
10704  __pyx_L0:;
10705  __Pyx_XGIVEREF(__pyx_r);
10706  __Pyx_RefNannyFinishContext();
10707  return __pyx_r;
10708 }
10709 
10710 /* "View.MemoryView":236
10711  * return getattr(self.memview, attr)
10712  *
10713  * def __getitem__(self, item): # <<<<<<<<<<<<<<
10714  * return self.memview[item]
10715  *
10716  */
10717 
10718 /* Python wrapper */
10719 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
10720 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
10721  PyObject *__pyx_r = 0;
10722  __Pyx_RefNannyDeclarations
10723  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
10724  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
10725 
10726  /* function exit code */
10727  __Pyx_RefNannyFinishContext();
10728  return __pyx_r;
10729 }
10730 
10731 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
10732  PyObject *__pyx_r = NULL;
10733  __Pyx_RefNannyDeclarations
10734  PyObject *__pyx_t_1 = NULL;
10735  PyObject *__pyx_t_2 = NULL;
10736  __Pyx_RefNannySetupContext("__getitem__", 0);
10737 
10738  /* "View.MemoryView":237
10739  *
10740  * def __getitem__(self, item):
10741  * return self.memview[item] # <<<<<<<<<<<<<<
10742  *
10743  * def __setitem__(self, item, value):
10744  */
10745  __Pyx_XDECREF(__pyx_r);
10746  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
10747  __Pyx_GOTREF(__pyx_t_1);
10748  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
10749  __Pyx_GOTREF(__pyx_t_2);
10750  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10751  __pyx_r = __pyx_t_2;
10752  __pyx_t_2 = 0;
10753  goto __pyx_L0;
10754 
10755  /* "View.MemoryView":236
10756  * return getattr(self.memview, attr)
10757  *
10758  * def __getitem__(self, item): # <<<<<<<<<<<<<<
10759  * return self.memview[item]
10760  *
10761  */
10762 
10763  /* function exit code */
10764  __pyx_L1_error:;
10765  __Pyx_XDECREF(__pyx_t_1);
10766  __Pyx_XDECREF(__pyx_t_2);
10767  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10768  __pyx_r = NULL;
10769  __pyx_L0:;
10770  __Pyx_XGIVEREF(__pyx_r);
10771  __Pyx_RefNannyFinishContext();
10772  return __pyx_r;
10773 }
10774 
10775 /* "View.MemoryView":239
10776  * return self.memview[item]
10777  *
10778  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
10779  * self.memview[item] = value
10780  *
10781  */
10782 
10783 /* Python wrapper */
10784 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
10785 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10786  int __pyx_r;
10787  __Pyx_RefNannyDeclarations
10788  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
10789  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
10790 
10791  /* function exit code */
10792  __Pyx_RefNannyFinishContext();
10793  return __pyx_r;
10794 }
10795 
10796 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10797  int __pyx_r;
10798  __Pyx_RefNannyDeclarations
10799  PyObject *__pyx_t_1 = NULL;
10800  __Pyx_RefNannySetupContext("__setitem__", 0);
10801 
10802  /* "View.MemoryView":240
10803  *
10804  * def __setitem__(self, item, value):
10805  * self.memview[item] = value # <<<<<<<<<<<<<<
10806  *
10807  *
10808  */
10809  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
10810  __Pyx_GOTREF(__pyx_t_1);
10811  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
10812  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10813 
10814  /* "View.MemoryView":239
10815  * return self.memview[item]
10816  *
10817  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
10818  * self.memview[item] = value
10819  *
10820  */
10821 
10822  /* function exit code */
10823  __pyx_r = 0;
10824  goto __pyx_L0;
10825  __pyx_L1_error:;
10826  __Pyx_XDECREF(__pyx_t_1);
10827  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10828  __pyx_r = -1;
10829  __pyx_L0:;
10830  __Pyx_RefNannyFinishContext();
10831  return __pyx_r;
10832 }
10833 
10834 /* "(tree fragment)":1
10835  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10836  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10837  * def __setstate_cython__(self, __pyx_state):
10838  */
10839 
10840 /* Python wrapper */
10841 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10842 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10843  PyObject *__pyx_r = 0;
10844  __Pyx_RefNannyDeclarations
10845  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10846  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
10847 
10848  /* function exit code */
10849  __Pyx_RefNannyFinishContext();
10850  return __pyx_r;
10851 }
10852 
10853 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
10854  PyObject *__pyx_r = NULL;
10855  __Pyx_RefNannyDeclarations
10856  PyObject *__pyx_t_1 = NULL;
10857  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10858 
10859  /* "(tree fragment)":2
10860  * def __reduce_cython__(self):
10861  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10862  * def __setstate_cython__(self, __pyx_state):
10863  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10864  */
10865  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
10866  __Pyx_GOTREF(__pyx_t_1);
10867  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10868  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10869  __PYX_ERR(1, 2, __pyx_L1_error)
10870 
10871  /* "(tree fragment)":1
10872  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10873  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10874  * def __setstate_cython__(self, __pyx_state):
10875  */
10876 
10877  /* function exit code */
10878  __pyx_L1_error:;
10879  __Pyx_XDECREF(__pyx_t_1);
10880  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10881  __pyx_r = NULL;
10882  __Pyx_XGIVEREF(__pyx_r);
10883  __Pyx_RefNannyFinishContext();
10884  return __pyx_r;
10885 }
10886 
10887 /* "(tree fragment)":3
10888  * def __reduce_cython__(self):
10889  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10890  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10891  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10892  */
10893 
10894 /* Python wrapper */
10895 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10896 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10897  PyObject *__pyx_r = 0;
10898  __Pyx_RefNannyDeclarations
10899  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10900  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10901 
10902  /* function exit code */
10903  __Pyx_RefNannyFinishContext();
10904  return __pyx_r;
10905 }
10906 
10907 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10908  PyObject *__pyx_r = NULL;
10909  __Pyx_RefNannyDeclarations
10910  PyObject *__pyx_t_1 = NULL;
10911  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10912 
10913  /* "(tree fragment)":4
10914  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10915  * def __setstate_cython__(self, __pyx_state):
10916  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10917  */
10918  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10919  __Pyx_GOTREF(__pyx_t_1);
10920  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10921  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10922  __PYX_ERR(1, 4, __pyx_L1_error)
10923 
10924  /* "(tree fragment)":3
10925  * def __reduce_cython__(self):
10926  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10927  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10928  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10929  */
10930 
10931  /* function exit code */
10932  __pyx_L1_error:;
10933  __Pyx_XDECREF(__pyx_t_1);
10934  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10935  __pyx_r = NULL;
10936  __Pyx_XGIVEREF(__pyx_r);
10937  __Pyx_RefNannyFinishContext();
10938  return __pyx_r;
10939 }
10940 
10941 /* "View.MemoryView":244
10942  *
10943  * @cname("__pyx_array_new")
10944  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10945  * char *mode, char *buf):
10946  * cdef array result
10947  */
10948 
10949 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
10950  struct __pyx_array_obj *__pyx_v_result = 0;
10951  struct __pyx_array_obj *__pyx_r = NULL;
10952  __Pyx_RefNannyDeclarations
10953  int __pyx_t_1;
10954  PyObject *__pyx_t_2 = NULL;
10955  PyObject *__pyx_t_3 = NULL;
10956  PyObject *__pyx_t_4 = NULL;
10957  PyObject *__pyx_t_5 = NULL;
10958  __Pyx_RefNannySetupContext("array_cwrapper", 0);
10959 
10960  /* "View.MemoryView":248
10961  * cdef array result
10962  *
10963  * if buf == NULL: # <<<<<<<<<<<<<<
10964  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10965  * else:
10966  */
10967  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
10968  if (__pyx_t_1) {
10969 
10970  /* "View.MemoryView":249
10971  *
10972  * if buf == NULL:
10973  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
10974  * else:
10975  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10976  */
10977  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
10978  __Pyx_GOTREF(__pyx_t_2);
10979  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
10980  __Pyx_GOTREF(__pyx_t_3);
10981  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
10982  __Pyx_GOTREF(__pyx_t_4);
10983  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
10984  __Pyx_GOTREF(__pyx_t_5);
10985  __Pyx_INCREF(__pyx_v_shape);
10986  __Pyx_GIVEREF(__pyx_v_shape);
10987  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10988  __Pyx_GIVEREF(__pyx_t_2);
10989  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10990  __Pyx_GIVEREF(__pyx_t_3);
10991  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10992  __Pyx_GIVEREF(__pyx_t_4);
10993  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10994  __pyx_t_2 = 0;
10995  __pyx_t_3 = 0;
10996  __pyx_t_4 = 0;
10997  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
10998  __Pyx_GOTREF(__pyx_t_4);
10999  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11000  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
11001  __pyx_t_4 = 0;
11002 
11003  /* "View.MemoryView":248
11004  * cdef array result
11005  *
11006  * if buf == NULL: # <<<<<<<<<<<<<<
11007  * result = array(shape, itemsize, format, mode.decode('ASCII'))
11008  * else:
11009  */
11010  goto __pyx_L3;
11011  }
11012 
11013  /* "View.MemoryView":251
11014  * result = array(shape, itemsize, format, mode.decode('ASCII'))
11015  * else:
11016  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
11017  * allocate_buffer=False)
11018  * result.data = buf
11019  */
11020  /*else*/ {
11021  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
11022  __Pyx_GOTREF(__pyx_t_4);
11023  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
11024  __Pyx_GOTREF(__pyx_t_5);
11025  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
11026  __Pyx_GOTREF(__pyx_t_3);
11027  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
11028  __Pyx_GOTREF(__pyx_t_2);
11029  __Pyx_INCREF(__pyx_v_shape);
11030  __Pyx_GIVEREF(__pyx_v_shape);
11031  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
11032  __Pyx_GIVEREF(__pyx_t_4);
11033  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
11034  __Pyx_GIVEREF(__pyx_t_5);
11035  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
11036  __Pyx_GIVEREF(__pyx_t_3);
11037  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
11038  __pyx_t_4 = 0;
11039  __pyx_t_5 = 0;
11040  __pyx_t_3 = 0;
11041 
11042  /* "View.MemoryView":252
11043  * else:
11044  * result = array(shape, itemsize, format, mode.decode('ASCII'),
11045  * allocate_buffer=False) # <<<<<<<<<<<<<<
11046  * result.data = buf
11047  *
11048  */
11049  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
11050  __Pyx_GOTREF(__pyx_t_3);
11051  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
11052 
11053  /* "View.MemoryView":251
11054  * result = array(shape, itemsize, format, mode.decode('ASCII'))
11055  * else:
11056  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
11057  * allocate_buffer=False)
11058  * result.data = buf
11059  */
11060  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
11061  __Pyx_GOTREF(__pyx_t_5);
11062  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11063  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11064  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
11065  __pyx_t_5 = 0;
11066 
11067  /* "View.MemoryView":253
11068  * result = array(shape, itemsize, format, mode.decode('ASCII'),
11069  * allocate_buffer=False)
11070  * result.data = buf # <<<<<<<<<<<<<<
11071  *
11072  * return result
11073  */
11074  __pyx_v_result->data = __pyx_v_buf;
11075  }
11076  __pyx_L3:;
11077 
11078  /* "View.MemoryView":255
11079  * result.data = buf
11080  *
11081  * return result # <<<<<<<<<<<<<<
11082  *
11083  *
11084  */
11085  __Pyx_XDECREF(((PyObject *)__pyx_r));
11086  __Pyx_INCREF(((PyObject *)__pyx_v_result));
11087  __pyx_r = __pyx_v_result;
11088  goto __pyx_L0;
11089 
11090  /* "View.MemoryView":244
11091  *
11092  * @cname("__pyx_array_new")
11093  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
11094  * char *mode, char *buf):
11095  * cdef array result
11096  */
11097 
11098  /* function exit code */
11099  __pyx_L1_error:;
11100  __Pyx_XDECREF(__pyx_t_2);
11101  __Pyx_XDECREF(__pyx_t_3);
11102  __Pyx_XDECREF(__pyx_t_4);
11103  __Pyx_XDECREF(__pyx_t_5);
11104  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
11105  __pyx_r = 0;
11106  __pyx_L0:;
11107  __Pyx_XDECREF((PyObject *)__pyx_v_result);
11108  __Pyx_XGIVEREF((PyObject *)__pyx_r);
11109  __Pyx_RefNannyFinishContext();
11110  return __pyx_r;
11111 }
11112 
11113 /* "View.MemoryView":281
11114  * cdef class Enum(object):
11115  * cdef object name
11116  * def __init__(self, name): # <<<<<<<<<<<<<<
11117  * self.name = name
11118  * def __repr__(self):
11119  */
11120 
11121 /* Python wrapper */
11122 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11123 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11124  PyObject *__pyx_v_name = 0;
11125  int __pyx_r;
11126  __Pyx_RefNannyDeclarations
11127  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
11128  {
11129  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
11130  PyObject* values[1] = {0};
11131  if (unlikely(__pyx_kwds)) {
11132  Py_ssize_t kw_args;
11133  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11134  switch (pos_args) {
11135  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11136  CYTHON_FALLTHROUGH;
11137  case 0: break;
11138  default: goto __pyx_L5_argtuple_error;
11139  }
11140  kw_args = PyDict_Size(__pyx_kwds);
11141  switch (pos_args) {
11142  case 0:
11143  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
11144  else goto __pyx_L5_argtuple_error;
11145  }
11146  if (unlikely(kw_args > 0)) {
11147  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
11148  }
11149  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
11150  goto __pyx_L5_argtuple_error;
11151  } else {
11152  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11153  }
11154  __pyx_v_name = values[0];
11155  }
11156  goto __pyx_L4_argument_unpacking_done;
11157  __pyx_L5_argtuple_error:;
11158  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
11159  __pyx_L3_error:;
11160  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11161  __Pyx_RefNannyFinishContext();
11162  return -1;
11163  __pyx_L4_argument_unpacking_done:;
11164  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
11165 
11166  /* function exit code */
11167  __Pyx_RefNannyFinishContext();
11168  return __pyx_r;
11169 }
11170 
11171 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
11172  int __pyx_r;
11173  __Pyx_RefNannyDeclarations
11174  __Pyx_RefNannySetupContext("__init__", 0);
11175 
11176  /* "View.MemoryView":282
11177  * cdef object name
11178  * def __init__(self, name):
11179  * self.name = name # <<<<<<<<<<<<<<
11180  * def __repr__(self):
11181  * return self.name
11182  */
11183  __Pyx_INCREF(__pyx_v_name);
11184  __Pyx_GIVEREF(__pyx_v_name);
11185  __Pyx_GOTREF(__pyx_v_self->name);
11186  __Pyx_DECREF(__pyx_v_self->name);
11187  __pyx_v_self->name = __pyx_v_name;
11188 
11189  /* "View.MemoryView":281
11190  * cdef class Enum(object):
11191  * cdef object name
11192  * def __init__(self, name): # <<<<<<<<<<<<<<
11193  * self.name = name
11194  * def __repr__(self):
11195  */
11196 
11197  /* function exit code */
11198  __pyx_r = 0;
11199  __Pyx_RefNannyFinishContext();
11200  return __pyx_r;
11201 }
11202 
11203 /* "View.MemoryView":283
11204  * def __init__(self, name):
11205  * self.name = name
11206  * def __repr__(self): # <<<<<<<<<<<<<<
11207  * return self.name
11208  *
11209  */
11210 
11211 /* Python wrapper */
11212 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
11213 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
11214  PyObject *__pyx_r = 0;
11215  __Pyx_RefNannyDeclarations
11216  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
11217  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
11218 
11219  /* function exit code */
11220  __Pyx_RefNannyFinishContext();
11221  return __pyx_r;
11222 }
11223 
11224 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
11225  PyObject *__pyx_r = NULL;
11226  __Pyx_RefNannyDeclarations
11227  __Pyx_RefNannySetupContext("__repr__", 0);
11228 
11229  /* "View.MemoryView":284
11230  * self.name = name
11231  * def __repr__(self):
11232  * return self.name # <<<<<<<<<<<<<<
11233  *
11234  * cdef generic = Enum("<strided and direct or indirect>")
11235  */
11236  __Pyx_XDECREF(__pyx_r);
11237  __Pyx_INCREF(__pyx_v_self->name);
11238  __pyx_r = __pyx_v_self->name;
11239  goto __pyx_L0;
11240 
11241  /* "View.MemoryView":283
11242  * def __init__(self, name):
11243  * self.name = name
11244  * def __repr__(self): # <<<<<<<<<<<<<<
11245  * return self.name
11246  *
11247  */
11248 
11249  /* function exit code */
11250  __pyx_L0:;
11251  __Pyx_XGIVEREF(__pyx_r);
11252  __Pyx_RefNannyFinishContext();
11253  return __pyx_r;
11254 }
11255 
11256 /* "(tree fragment)":1
11257  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11258  * cdef tuple state
11259  * cdef object _dict
11260  */
11261 
11262 /* Python wrapper */
11263 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11264 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11265  PyObject *__pyx_r = 0;
11266  __Pyx_RefNannyDeclarations
11267  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11268  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
11269 
11270  /* function exit code */
11271  __Pyx_RefNannyFinishContext();
11272  return __pyx_r;
11273 }
11274 
11275 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
11276  PyObject *__pyx_v_state = 0;
11277  PyObject *__pyx_v__dict = 0;
11278  int __pyx_v_use_setstate;
11279  PyObject *__pyx_r = NULL;
11280  __Pyx_RefNannyDeclarations
11281  PyObject *__pyx_t_1 = NULL;
11282  int __pyx_t_2;
11283  int __pyx_t_3;
11284  PyObject *__pyx_t_4 = NULL;
11285  PyObject *__pyx_t_5 = NULL;
11286  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
11287 
11288  /* "(tree fragment)":5
11289  * cdef object _dict
11290  * cdef bint use_setstate
11291  * state = (self.name,) # <<<<<<<<<<<<<<
11292  * _dict = getattr(self, '__dict__', None)
11293  * if _dict is not None:
11294  */
11295  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
11296  __Pyx_GOTREF(__pyx_t_1);
11297  __Pyx_INCREF(__pyx_v_self->name);
11298  __Pyx_GIVEREF(__pyx_v_self->name);
11299  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
11300  __pyx_v_state = ((PyObject*)__pyx_t_1);
11301  __pyx_t_1 = 0;
11302 
11303  /* "(tree fragment)":6
11304  * cdef bint use_setstate
11305  * state = (self.name,)
11306  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
11307  * if _dict is not None:
11308  * state += (_dict,)
11309  */
11310  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
11311  __Pyx_GOTREF(__pyx_t_1);
11312  __pyx_v__dict = __pyx_t_1;
11313  __pyx_t_1 = 0;
11314 
11315  /* "(tree fragment)":7
11316  * state = (self.name,)
11317  * _dict = getattr(self, '__dict__', None)
11318  * if _dict is not None: # <<<<<<<<<<<<<<
11319  * state += (_dict,)
11320  * use_setstate = True
11321  */
11322  __pyx_t_2 = (__pyx_v__dict != Py_None);
11323  __pyx_t_3 = (__pyx_t_2 != 0);
11324  if (__pyx_t_3) {
11325 
11326  /* "(tree fragment)":8
11327  * _dict = getattr(self, '__dict__', None)
11328  * if _dict is not None:
11329  * state += (_dict,) # <<<<<<<<<<<<<<
11330  * use_setstate = True
11331  * else:
11332  */
11333  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
11334  __Pyx_GOTREF(__pyx_t_1);
11335  __Pyx_INCREF(__pyx_v__dict);
11336  __Pyx_GIVEREF(__pyx_v__dict);
11337  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
11338  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
11339  __Pyx_GOTREF(__pyx_t_4);
11340  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11341  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
11342  __pyx_t_4 = 0;
11343 
11344  /* "(tree fragment)":9
11345  * if _dict is not None:
11346  * state += (_dict,)
11347  * use_setstate = True # <<<<<<<<<<<<<<
11348  * else:
11349  * use_setstate = self.name is not None
11350  */
11351  __pyx_v_use_setstate = 1;
11352 
11353  /* "(tree fragment)":7
11354  * state = (self.name,)
11355  * _dict = getattr(self, '__dict__', None)
11356  * if _dict is not None: # <<<<<<<<<<<<<<
11357  * state += (_dict,)
11358  * use_setstate = True
11359  */
11360  goto __pyx_L3;
11361  }
11362 
11363  /* "(tree fragment)":11
11364  * use_setstate = True
11365  * else:
11366  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
11367  * if use_setstate:
11368  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11369  */
11370  /*else*/ {
11371  __pyx_t_3 = (__pyx_v_self->name != Py_None);
11372  __pyx_v_use_setstate = __pyx_t_3;
11373  }
11374  __pyx_L3:;
11375 
11376  /* "(tree fragment)":12
11377  * else:
11378  * use_setstate = self.name is not None
11379  * if use_setstate: # <<<<<<<<<<<<<<
11380  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11381  * else:
11382  */
11383  __pyx_t_3 = (__pyx_v_use_setstate != 0);
11384  if (__pyx_t_3) {
11385 
11386  /* "(tree fragment)":13
11387  * use_setstate = self.name is not None
11388  * if use_setstate:
11389  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
11390  * else:
11391  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11392  */
11393  __Pyx_XDECREF(__pyx_r);
11394  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
11395  __Pyx_GOTREF(__pyx_t_4);
11396  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
11397  __Pyx_GOTREF(__pyx_t_1);
11398  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11399  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11400  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11401  __Pyx_INCREF(__pyx_int_184977713);
11402  __Pyx_GIVEREF(__pyx_int_184977713);
11403  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11404  __Pyx_INCREF(Py_None);
11405  __Pyx_GIVEREF(Py_None);
11406  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
11407  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
11408  __Pyx_GOTREF(__pyx_t_5);
11409  __Pyx_GIVEREF(__pyx_t_4);
11410  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11411  __Pyx_GIVEREF(__pyx_t_1);
11412  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
11413  __Pyx_INCREF(__pyx_v_state);
11414  __Pyx_GIVEREF(__pyx_v_state);
11415  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
11416  __pyx_t_4 = 0;
11417  __pyx_t_1 = 0;
11418  __pyx_r = __pyx_t_5;
11419  __pyx_t_5 = 0;
11420  goto __pyx_L0;
11421 
11422  /* "(tree fragment)":12
11423  * else:
11424  * use_setstate = self.name is not None
11425  * if use_setstate: # <<<<<<<<<<<<<<
11426  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11427  * else:
11428  */
11429  }
11430 
11431  /* "(tree fragment)":15
11432  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11433  * else:
11434  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
11435  * def __setstate_cython__(self, __pyx_state):
11436  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
11437  */
11438  /*else*/ {
11439  __Pyx_XDECREF(__pyx_r);
11440  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
11441  __Pyx_GOTREF(__pyx_t_5);
11442  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
11443  __Pyx_GOTREF(__pyx_t_1);
11444  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11445  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11446  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11447  __Pyx_INCREF(__pyx_int_184977713);
11448  __Pyx_GIVEREF(__pyx_int_184977713);
11449  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11450  __Pyx_INCREF(__pyx_v_state);
11451  __Pyx_GIVEREF(__pyx_v_state);
11452  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
11453  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
11454  __Pyx_GOTREF(__pyx_t_4);
11455  __Pyx_GIVEREF(__pyx_t_5);
11456  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
11457  __Pyx_GIVEREF(__pyx_t_1);
11458  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
11459  __pyx_t_5 = 0;
11460  __pyx_t_1 = 0;
11461  __pyx_r = __pyx_t_4;
11462  __pyx_t_4 = 0;
11463  goto __pyx_L0;
11464  }
11465 
11466  /* "(tree fragment)":1
11467  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11468  * cdef tuple state
11469  * cdef object _dict
11470  */
11471 
11472  /* function exit code */
11473  __pyx_L1_error:;
11474  __Pyx_XDECREF(__pyx_t_1);
11475  __Pyx_XDECREF(__pyx_t_4);
11476  __Pyx_XDECREF(__pyx_t_5);
11477  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11478  __pyx_r = NULL;
11479  __pyx_L0:;
11480  __Pyx_XDECREF(__pyx_v_state);
11481  __Pyx_XDECREF(__pyx_v__dict);
11482  __Pyx_XGIVEREF(__pyx_r);
11483  __Pyx_RefNannyFinishContext();
11484  return __pyx_r;
11485 }
11486 
11487 /* "(tree fragment)":16
11488  * else:
11489  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11490  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11491  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
11492  */
11493 
11494 /* Python wrapper */
11495 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
11496 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11497  PyObject *__pyx_r = 0;
11498  __Pyx_RefNannyDeclarations
11499  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11500  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11501 
11502  /* function exit code */
11503  __Pyx_RefNannyFinishContext();
11504  return __pyx_r;
11505 }
11506 
11507 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11508  PyObject *__pyx_r = NULL;
11509  __Pyx_RefNannyDeclarations
11510  PyObject *__pyx_t_1 = NULL;
11511  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
11512 
11513  /* "(tree fragment)":17
11514  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11515  * def __setstate_cython__(self, __pyx_state):
11516  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
11517  */
11518  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
11519  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
11520  __Pyx_GOTREF(__pyx_t_1);
11521  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11522 
11523  /* "(tree fragment)":16
11524  * else:
11525  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11526  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11527  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
11528  */
11529 
11530  /* function exit code */
11531  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11532  goto __pyx_L0;
11533  __pyx_L1_error:;
11534  __Pyx_XDECREF(__pyx_t_1);
11535  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11536  __pyx_r = NULL;
11537  __pyx_L0:;
11538  __Pyx_XGIVEREF(__pyx_r);
11539  __Pyx_RefNannyFinishContext();
11540  return __pyx_r;
11541 }
11542 
11543 /* "View.MemoryView":298
11544  *
11545  * @cname('__pyx_align_pointer')
11546  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
11547  * "Align pointer memory on a given boundary"
11548  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
11549  */
11550 
11551 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
11552  Py_intptr_t __pyx_v_aligned_p;
11553  size_t __pyx_v_offset;
11554  void *__pyx_r;
11555  int __pyx_t_1;
11556 
11557  /* "View.MemoryView":300
11558  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
11559  * "Align pointer memory on a given boundary"
11560  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
11561  * cdef size_t offset
11562  *
11563  */
11564  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
11565 
11566  /* "View.MemoryView":304
11567  *
11568  * with cython.cdivision(True):
11569  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
11570  *
11571  * if offset > 0:
11572  */
11573  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
11574 
11575  /* "View.MemoryView":306
11576  * offset = aligned_p % alignment
11577  *
11578  * if offset > 0: # <<<<<<<<<<<<<<
11579  * aligned_p += alignment - offset
11580  *
11581  */
11582  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
11583  if (__pyx_t_1) {
11584 
11585  /* "View.MemoryView":307
11586  *
11587  * if offset > 0:
11588  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
11589  *
11590  * return <void *> aligned_p
11591  */
11592  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
11593 
11594  /* "View.MemoryView":306
11595  * offset = aligned_p % alignment
11596  *
11597  * if offset > 0: # <<<<<<<<<<<<<<
11598  * aligned_p += alignment - offset
11599  *
11600  */
11601  }
11602 
11603  /* "View.MemoryView":309
11604  * aligned_p += alignment - offset
11605  *
11606  * return <void *> aligned_p # <<<<<<<<<<<<<<
11607  *
11608  *
11609  */
11610  __pyx_r = ((void *)__pyx_v_aligned_p);
11611  goto __pyx_L0;
11612 
11613  /* "View.MemoryView":298
11614  *
11615  * @cname('__pyx_align_pointer')
11616  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
11617  * "Align pointer memory on a given boundary"
11618  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
11619  */
11620 
11621  /* function exit code */
11622  __pyx_L0:;
11623  return __pyx_r;
11624 }
11625 
11626 /* "View.MemoryView":345
11627  * cdef __Pyx_TypeInfo *typeinfo
11628  *
11629  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11630  * self.obj = obj
11631  * self.flags = flags
11632  */
11633 
11634 /* Python wrapper */
11635 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11636 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11637  PyObject *__pyx_v_obj = 0;
11638  int __pyx_v_flags;
11639  int __pyx_v_dtype_is_object;
11640  int __pyx_r;
11641  __Pyx_RefNannyDeclarations
11642  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
11643  {
11644  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
11645  PyObject* values[3] = {0,0,0};
11646  if (unlikely(__pyx_kwds)) {
11647  Py_ssize_t kw_args;
11648  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11649  switch (pos_args) {
11650  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11651  CYTHON_FALLTHROUGH;
11652  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11653  CYTHON_FALLTHROUGH;
11654  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11655  CYTHON_FALLTHROUGH;
11656  case 0: break;
11657  default: goto __pyx_L5_argtuple_error;
11658  }
11659  kw_args = PyDict_Size(__pyx_kwds);
11660  switch (pos_args) {
11661  case 0:
11662  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
11663  else goto __pyx_L5_argtuple_error;
11664  CYTHON_FALLTHROUGH;
11665  case 1:
11666  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
11667  else {
11668  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
11669  }
11670  CYTHON_FALLTHROUGH;
11671  case 2:
11672  if (kw_args > 0) {
11673  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
11674  if (value) { values[2] = value; kw_args--; }
11675  }
11676  }
11677  if (unlikely(kw_args > 0)) {
11678  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
11679  }
11680  } else {
11681  switch (PyTuple_GET_SIZE(__pyx_args)) {
11682  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11683  CYTHON_FALLTHROUGH;
11684  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11685  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11686  break;
11687  default: goto __pyx_L5_argtuple_error;
11688  }
11689  }
11690  __pyx_v_obj = values[0];
11691  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
11692  if (values[2]) {
11693  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
11694  } else {
11695  __pyx_v_dtype_is_object = ((int)0);
11696  }
11697  }
11698  goto __pyx_L4_argument_unpacking_done;
11699  __pyx_L5_argtuple_error:;
11700  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
11701  __pyx_L3_error:;
11702  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11703  __Pyx_RefNannyFinishContext();
11704  return -1;
11705  __pyx_L4_argument_unpacking_done:;
11706  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
11707 
11708  /* function exit code */
11709  __Pyx_RefNannyFinishContext();
11710  return __pyx_r;
11711 }
11712 
11713 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
11714  int __pyx_r;
11715  __Pyx_RefNannyDeclarations
11716  int __pyx_t_1;
11717  int __pyx_t_2;
11718  int __pyx_t_3;
11719  int __pyx_t_4;
11720  __Pyx_RefNannySetupContext("__cinit__", 0);
11721 
11722  /* "View.MemoryView":346
11723  *
11724  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
11725  * self.obj = obj # <<<<<<<<<<<<<<
11726  * self.flags = flags
11727  * if type(self) is memoryview or obj is not None:
11728  */
11729  __Pyx_INCREF(__pyx_v_obj);
11730  __Pyx_GIVEREF(__pyx_v_obj);
11731  __Pyx_GOTREF(__pyx_v_self->obj);
11732  __Pyx_DECREF(__pyx_v_self->obj);
11733  __pyx_v_self->obj = __pyx_v_obj;
11734 
11735  /* "View.MemoryView":347
11736  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
11737  * self.obj = obj
11738  * self.flags = flags # <<<<<<<<<<<<<<
11739  * if type(self) is memoryview or obj is not None:
11740  * __Pyx_GetBuffer(obj, &self.view, flags)
11741  */
11742  __pyx_v_self->flags = __pyx_v_flags;
11743 
11744  /* "View.MemoryView":348
11745  * self.obj = obj
11746  * self.flags = flags
11747  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
11748  * __Pyx_GetBuffer(obj, &self.view, flags)
11749  * if <PyObject *> self.view.obj == NULL:
11750  */
11751  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
11752  __pyx_t_3 = (__pyx_t_2 != 0);
11753  if (!__pyx_t_3) {
11754  } else {
11755  __pyx_t_1 = __pyx_t_3;
11756  goto __pyx_L4_bool_binop_done;
11757  }
11758  __pyx_t_3 = (__pyx_v_obj != Py_None);
11759  __pyx_t_2 = (__pyx_t_3 != 0);
11760  __pyx_t_1 = __pyx_t_2;
11761  __pyx_L4_bool_binop_done:;
11762  if (__pyx_t_1) {
11763 
11764  /* "View.MemoryView":349
11765  * self.flags = flags
11766  * if type(self) is memoryview or obj is not None:
11767  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
11768  * if <PyObject *> self.view.obj == NULL:
11769  * (<__pyx_buffer *> &self.view).obj = Py_None
11770  */
11771  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
11772 
11773  /* "View.MemoryView":350
11774  * if type(self) is memoryview or obj is not None:
11775  * __Pyx_GetBuffer(obj, &self.view, flags)
11776  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
11777  * (<__pyx_buffer *> &self.view).obj = Py_None
11778  * Py_INCREF(Py_None)
11779  */
11780  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
11781  if (__pyx_t_1) {
11782 
11783  /* "View.MemoryView":351
11784  * __Pyx_GetBuffer(obj, &self.view, flags)
11785  * if <PyObject *> self.view.obj == NULL:
11786  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
11787  * Py_INCREF(Py_None)
11788  *
11789  */
11790  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
11791 
11792  /* "View.MemoryView":352
11793  * if <PyObject *> self.view.obj == NULL:
11794  * (<__pyx_buffer *> &self.view).obj = Py_None
11795  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
11796  *
11797  * global __pyx_memoryview_thread_locks_used
11798  */
11799  Py_INCREF(Py_None);
11800 
11801  /* "View.MemoryView":350
11802  * if type(self) is memoryview or obj is not None:
11803  * __Pyx_GetBuffer(obj, &self.view, flags)
11804  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
11805  * (<__pyx_buffer *> &self.view).obj = Py_None
11806  * Py_INCREF(Py_None)
11807  */
11808  }
11809 
11810  /* "View.MemoryView":348
11811  * self.obj = obj
11812  * self.flags = flags
11813  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
11814  * __Pyx_GetBuffer(obj, &self.view, flags)
11815  * if <PyObject *> self.view.obj == NULL:
11816  */
11817  }
11818 
11819  /* "View.MemoryView":355
11820  *
11821  * global __pyx_memoryview_thread_locks_used
11822  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
11823  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11824  * __pyx_memoryview_thread_locks_used += 1
11825  */
11826  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
11827  if (__pyx_t_1) {
11828 
11829  /* "View.MemoryView":356
11830  * global __pyx_memoryview_thread_locks_used
11831  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
11832  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
11833  * __pyx_memoryview_thread_locks_used += 1
11834  * if self.lock is NULL:
11835  */
11836  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11837 
11838  /* "View.MemoryView":357
11839  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
11840  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11841  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
11842  * if self.lock is NULL:
11843  * self.lock = PyThread_allocate_lock()
11844  */
11845  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
11846 
11847  /* "View.MemoryView":355
11848  *
11849  * global __pyx_memoryview_thread_locks_used
11850  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
11851  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11852  * __pyx_memoryview_thread_locks_used += 1
11853  */
11854  }
11855 
11856  /* "View.MemoryView":358
11857  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11858  * __pyx_memoryview_thread_locks_used += 1
11859  * if self.lock is NULL: # <<<<<<<<<<<<<<
11860  * self.lock = PyThread_allocate_lock()
11861  * if self.lock is NULL:
11862  */
11863  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11864  if (__pyx_t_1) {
11865 
11866  /* "View.MemoryView":359
11867  * __pyx_memoryview_thread_locks_used += 1
11868  * if self.lock is NULL:
11869  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
11870  * if self.lock is NULL:
11871  * raise MemoryError
11872  */
11873  __pyx_v_self->lock = PyThread_allocate_lock();
11874 
11875  /* "View.MemoryView":360
11876  * if self.lock is NULL:
11877  * self.lock = PyThread_allocate_lock()
11878  * if self.lock is NULL: # <<<<<<<<<<<<<<
11879  * raise MemoryError
11880  *
11881  */
11882  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11883  if (unlikely(__pyx_t_1)) {
11884 
11885  /* "View.MemoryView":361
11886  * self.lock = PyThread_allocate_lock()
11887  * if self.lock is NULL:
11888  * raise MemoryError # <<<<<<<<<<<<<<
11889  *
11890  * if flags & PyBUF_FORMAT:
11891  */
11892  PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
11893 
11894  /* "View.MemoryView":360
11895  * if self.lock is NULL:
11896  * self.lock = PyThread_allocate_lock()
11897  * if self.lock is NULL: # <<<<<<<<<<<<<<
11898  * raise MemoryError
11899  *
11900  */
11901  }
11902 
11903  /* "View.MemoryView":358
11904  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11905  * __pyx_memoryview_thread_locks_used += 1
11906  * if self.lock is NULL: # <<<<<<<<<<<<<<
11907  * self.lock = PyThread_allocate_lock()
11908  * if self.lock is NULL:
11909  */
11910  }
11911 
11912  /* "View.MemoryView":363
11913  * raise MemoryError
11914  *
11915  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11916  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11917  * else:
11918  */
11919  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11920  if (__pyx_t_1) {
11921 
11922  /* "View.MemoryView":364
11923  *
11924  * if flags & PyBUF_FORMAT:
11925  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
11926  * else:
11927  * self.dtype_is_object = dtype_is_object
11928  */
11929  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
11930  if (__pyx_t_2) {
11931  } else {
11932  __pyx_t_1 = __pyx_t_2;
11933  goto __pyx_L11_bool_binop_done;
11934  }
11935  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
11936  __pyx_t_1 = __pyx_t_2;
11937  __pyx_L11_bool_binop_done:;
11938  __pyx_v_self->dtype_is_object = __pyx_t_1;
11939 
11940  /* "View.MemoryView":363
11941  * raise MemoryError
11942  *
11943  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11944  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11945  * else:
11946  */
11947  goto __pyx_L10;
11948  }
11949 
11950  /* "View.MemoryView":366
11951  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11952  * else:
11953  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
11954  *
11955  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11956  */
11957  /*else*/ {
11958  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11959  }
11960  __pyx_L10:;
11961 
11962  /* "View.MemoryView":368
11963  * self.dtype_is_object = dtype_is_object
11964  *
11965  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
11966  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11967  * self.typeinfo = NULL
11968  */
11969  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
11970 
11971  /* "View.MemoryView":370
11972  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11973  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11974  * self.typeinfo = NULL # <<<<<<<<<<<<<<
11975  *
11976  * def __dealloc__(memoryview self):
11977  */
11978  __pyx_v_self->typeinfo = NULL;
11979 
11980  /* "View.MemoryView":345
11981  * cdef __Pyx_TypeInfo *typeinfo
11982  *
11983  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11984  * self.obj = obj
11985  * self.flags = flags
11986  */
11987 
11988  /* function exit code */
11989  __pyx_r = 0;
11990  goto __pyx_L0;
11991  __pyx_L1_error:;
11992  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11993  __pyx_r = -1;
11994  __pyx_L0:;
11995  __Pyx_RefNannyFinishContext();
11996  return __pyx_r;
11997 }
11998 
11999 /* "View.MemoryView":372
12000  * self.typeinfo = NULL
12001  *
12002  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
12003  * if self.obj is not None:
12004  * __Pyx_ReleaseBuffer(&self.view)
12005  */
12006 
12007 /* Python wrapper */
12008 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
12009 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
12010  __Pyx_RefNannyDeclarations
12011  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
12012  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12013 
12014  /* function exit code */
12015  __Pyx_RefNannyFinishContext();
12016 }
12017 
12018 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
12019  int __pyx_v_i;
12020  __Pyx_RefNannyDeclarations
12021  int __pyx_t_1;
12022  int __pyx_t_2;
12023  int __pyx_t_3;
12024  int __pyx_t_4;
12025  int __pyx_t_5;
12026  PyThread_type_lock __pyx_t_6;
12027  PyThread_type_lock __pyx_t_7;
12028  __Pyx_RefNannySetupContext("__dealloc__", 0);
12029 
12030  /* "View.MemoryView":373
12031  *
12032  * def __dealloc__(memoryview self):
12033  * if self.obj is not None: # <<<<<<<<<<<<<<
12034  * __Pyx_ReleaseBuffer(&self.view)
12035  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
12036  */
12037  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
12038  __pyx_t_2 = (__pyx_t_1 != 0);
12039  if (__pyx_t_2) {
12040 
12041  /* "View.MemoryView":374
12042  * def __dealloc__(memoryview self):
12043  * if self.obj is not None:
12044  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
12045  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
12046  *
12047  */
12048  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
12049 
12050  /* "View.MemoryView":373
12051  *
12052  * def __dealloc__(memoryview self):
12053  * if self.obj is not None: # <<<<<<<<<<<<<<
12054  * __Pyx_ReleaseBuffer(&self.view)
12055  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
12056  */
12057  goto __pyx_L3;
12058  }
12059 
12060  /* "View.MemoryView":375
12061  * if self.obj is not None:
12062  * __Pyx_ReleaseBuffer(&self.view)
12063  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
12064  *
12065  * (<__pyx_buffer *> &self.view).obj = NULL
12066  */
12067  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
12068  if (__pyx_t_2) {
12069 
12070  /* "View.MemoryView":377
12071  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
12072  *
12073  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
12074  * Py_DECREF(Py_None)
12075  *
12076  */
12077  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
12078 
12079  /* "View.MemoryView":378
12080  *
12081  * (<__pyx_buffer *> &self.view).obj = NULL
12082  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
12083  *
12084  * cdef int i
12085  */
12086  Py_DECREF(Py_None);
12087 
12088  /* "View.MemoryView":375
12089  * if self.obj is not None:
12090  * __Pyx_ReleaseBuffer(&self.view)
12091  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
12092  *
12093  * (<__pyx_buffer *> &self.view).obj = NULL
12094  */
12095  }
12096  __pyx_L3:;
12097 
12098  /* "View.MemoryView":382
12099  * cdef int i
12100  * global __pyx_memoryview_thread_locks_used
12101  * if self.lock != NULL: # <<<<<<<<<<<<<<
12102  * for i in range(__pyx_memoryview_thread_locks_used):
12103  * if __pyx_memoryview_thread_locks[i] is self.lock:
12104  */
12105  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
12106  if (__pyx_t_2) {
12107 
12108  /* "View.MemoryView":383
12109  * global __pyx_memoryview_thread_locks_used
12110  * if self.lock != NULL:
12111  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
12112  * if __pyx_memoryview_thread_locks[i] is self.lock:
12113  * __pyx_memoryview_thread_locks_used -= 1
12114  */
12115  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
12116  __pyx_t_4 = __pyx_t_3;
12117  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
12118  __pyx_v_i = __pyx_t_5;
12119 
12120  /* "View.MemoryView":384
12121  * if self.lock != NULL:
12122  * for i in range(__pyx_memoryview_thread_locks_used):
12123  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
12124  * __pyx_memoryview_thread_locks_used -= 1
12125  * if i != __pyx_memoryview_thread_locks_used:
12126  */
12127  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
12128  if (__pyx_t_2) {
12129 
12130  /* "View.MemoryView":385
12131  * for i in range(__pyx_memoryview_thread_locks_used):
12132  * if __pyx_memoryview_thread_locks[i] is self.lock:
12133  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
12134  * if i != __pyx_memoryview_thread_locks_used:
12135  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
12136  */
12137  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
12138 
12139  /* "View.MemoryView":386
12140  * if __pyx_memoryview_thread_locks[i] is self.lock:
12141  * __pyx_memoryview_thread_locks_used -= 1
12142  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
12143  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
12144  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
12145  */
12146  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
12147  if (__pyx_t_2) {
12148 
12149  /* "View.MemoryView":388
12150  * if i != __pyx_memoryview_thread_locks_used:
12151  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
12152  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
12153  * break
12154  * else:
12155  */
12156  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
12157  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
12158 
12159  /* "View.MemoryView":387
12160  * __pyx_memoryview_thread_locks_used -= 1
12161  * if i != __pyx_memoryview_thread_locks_used:
12162  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
12163  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
12164  * break
12165  */
12166  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
12167  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
12168 
12169  /* "View.MemoryView":386
12170  * if __pyx_memoryview_thread_locks[i] is self.lock:
12171  * __pyx_memoryview_thread_locks_used -= 1
12172  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
12173  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
12174  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
12175  */
12176  }
12177 
12178  /* "View.MemoryView":389
12179  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
12180  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
12181  * break # <<<<<<<<<<<<<<
12182  * else:
12183  * PyThread_free_lock(self.lock)
12184  */
12185  goto __pyx_L6_break;
12186 
12187  /* "View.MemoryView":384
12188  * if self.lock != NULL:
12189  * for i in range(__pyx_memoryview_thread_locks_used):
12190  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
12191  * __pyx_memoryview_thread_locks_used -= 1
12192  * if i != __pyx_memoryview_thread_locks_used:
12193  */
12194  }
12195  }
12196  /*else*/ {
12197 
12198  /* "View.MemoryView":391
12199  * break
12200  * else:
12201  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
12202  *
12203  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
12204  */
12205  PyThread_free_lock(__pyx_v_self->lock);
12206  }
12207  __pyx_L6_break:;
12208 
12209  /* "View.MemoryView":382
12210  * cdef int i
12211  * global __pyx_memoryview_thread_locks_used
12212  * if self.lock != NULL: # <<<<<<<<<<<<<<
12213  * for i in range(__pyx_memoryview_thread_locks_used):
12214  * if __pyx_memoryview_thread_locks[i] is self.lock:
12215  */
12216  }
12217 
12218  /* "View.MemoryView":372
12219  * self.typeinfo = NULL
12220  *
12221  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
12222  * if self.obj is not None:
12223  * __Pyx_ReleaseBuffer(&self.view)
12224  */
12225 
12226  /* function exit code */
12227  __Pyx_RefNannyFinishContext();
12228 }
12229 
12230 /* "View.MemoryView":393
12231  * PyThread_free_lock(self.lock)
12232  *
12233  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
12234  * cdef Py_ssize_t dim
12235  * cdef char *itemp = <char *> self.view.buf
12236  */
12237 
12238 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
12239  Py_ssize_t __pyx_v_dim;
12240  char *__pyx_v_itemp;
12241  PyObject *__pyx_v_idx = NULL;
12242  char *__pyx_r;
12243  __Pyx_RefNannyDeclarations
12244  Py_ssize_t __pyx_t_1;
12245  PyObject *__pyx_t_2 = NULL;
12246  Py_ssize_t __pyx_t_3;
12247  PyObject *(*__pyx_t_4)(PyObject *);
12248  PyObject *__pyx_t_5 = NULL;
12249  Py_ssize_t __pyx_t_6;
12250  char *__pyx_t_7;
12251  __Pyx_RefNannySetupContext("get_item_pointer", 0);
12252 
12253  /* "View.MemoryView":395
12254  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
12255  * cdef Py_ssize_t dim
12256  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
12257  *
12258  * for dim, idx in enumerate(index):
12259  */
12260  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
12261 
12262  /* "View.MemoryView":397
12263  * cdef char *itemp = <char *> self.view.buf
12264  *
12265  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
12266  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
12267  *
12268  */
12269  __pyx_t_1 = 0;
12270  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
12271  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
12272  __pyx_t_4 = NULL;
12273  } else {
12274  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
12275  __Pyx_GOTREF(__pyx_t_2);
12276  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
12277  }
12278  for (;;) {
12279  if (likely(!__pyx_t_4)) {
12280  if (likely(PyList_CheckExact(__pyx_t_2))) {
12281  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
12282  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12283  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
12284  #else
12285  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
12286  __Pyx_GOTREF(__pyx_t_5);
12287  #endif
12288  } else {
12289  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
12290  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12291  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
12292  #else
12293  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
12294  __Pyx_GOTREF(__pyx_t_5);
12295  #endif
12296  }
12297  } else {
12298  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
12299  if (unlikely(!__pyx_t_5)) {
12300  PyObject* exc_type = PyErr_Occurred();
12301  if (exc_type) {
12302  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12303  else __PYX_ERR(1, 397, __pyx_L1_error)
12304  }
12305  break;
12306  }
12307  __Pyx_GOTREF(__pyx_t_5);
12308  }
12309  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
12310  __pyx_t_5 = 0;
12311  __pyx_v_dim = __pyx_t_1;
12312  __pyx_t_1 = (__pyx_t_1 + 1);
12313 
12314  /* "View.MemoryView":398
12315  *
12316  * for dim, idx in enumerate(index):
12317  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
12318  *
12319  * return itemp
12320  */
12321  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
12322  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
12323  __pyx_v_itemp = __pyx_t_7;
12324 
12325  /* "View.MemoryView":397
12326  * cdef char *itemp = <char *> self.view.buf
12327  *
12328  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
12329  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
12330  *
12331  */
12332  }
12333  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12334 
12335  /* "View.MemoryView":400
12336  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
12337  *
12338  * return itemp # <<<<<<<<<<<<<<
12339  *
12340  *
12341  */
12342  __pyx_r = __pyx_v_itemp;
12343  goto __pyx_L0;
12344 
12345  /* "View.MemoryView":393
12346  * PyThread_free_lock(self.lock)
12347  *
12348  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
12349  * cdef Py_ssize_t dim
12350  * cdef char *itemp = <char *> self.view.buf
12351  */
12352 
12353  /* function exit code */
12354  __pyx_L1_error:;
12355  __Pyx_XDECREF(__pyx_t_2);
12356  __Pyx_XDECREF(__pyx_t_5);
12357  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
12358  __pyx_r = NULL;
12359  __pyx_L0:;
12360  __Pyx_XDECREF(__pyx_v_idx);
12361  __Pyx_RefNannyFinishContext();
12362  return __pyx_r;
12363 }
12364 
12365 /* "View.MemoryView":403
12366  *
12367  *
12368  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
12369  * if index is Ellipsis:
12370  * return self
12371  */
12372 
12373 /* Python wrapper */
12374 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
12375 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
12376  PyObject *__pyx_r = 0;
12377  __Pyx_RefNannyDeclarations
12378  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
12379  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
12380 
12381  /* function exit code */
12382  __Pyx_RefNannyFinishContext();
12383  return __pyx_r;
12384 }
12385 
12386 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
12387  PyObject *__pyx_v_have_slices = NULL;
12388  PyObject *__pyx_v_indices = NULL;
12389  char *__pyx_v_itemp;
12390  PyObject *__pyx_r = NULL;
12391  __Pyx_RefNannyDeclarations
12392  int __pyx_t_1;
12393  int __pyx_t_2;
12394  PyObject *__pyx_t_3 = NULL;
12395  PyObject *__pyx_t_4 = NULL;
12396  PyObject *__pyx_t_5 = NULL;
12397  char *__pyx_t_6;
12398  __Pyx_RefNannySetupContext("__getitem__", 0);
12399 
12400  /* "View.MemoryView":404
12401  *
12402  * def __getitem__(memoryview self, object index):
12403  * if index is Ellipsis: # <<<<<<<<<<<<<<
12404  * return self
12405  *
12406  */
12407  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
12408  __pyx_t_2 = (__pyx_t_1 != 0);
12409  if (__pyx_t_2) {
12410 
12411  /* "View.MemoryView":405
12412  * def __getitem__(memoryview self, object index):
12413  * if index is Ellipsis:
12414  * return self # <<<<<<<<<<<<<<
12415  *
12416  * have_slices, indices = _unellipsify(index, self.view.ndim)
12417  */
12418  __Pyx_XDECREF(__pyx_r);
12419  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12420  __pyx_r = ((PyObject *)__pyx_v_self);
12421  goto __pyx_L0;
12422 
12423  /* "View.MemoryView":404
12424  *
12425  * def __getitem__(memoryview self, object index):
12426  * if index is Ellipsis: # <<<<<<<<<<<<<<
12427  * return self
12428  *
12429  */
12430  }
12431 
12432  /* "View.MemoryView":407
12433  * return self
12434  *
12435  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
12436  *
12437  * cdef char *itemp
12438  */
12439  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
12440  __Pyx_GOTREF(__pyx_t_3);
12441  if (likely(__pyx_t_3 != Py_None)) {
12442  PyObject* sequence = __pyx_t_3;
12443  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12444  if (unlikely(size != 2)) {
12445  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12446  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12447  __PYX_ERR(1, 407, __pyx_L1_error)
12448  }
12449  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12450  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
12451  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
12452  __Pyx_INCREF(__pyx_t_4);
12453  __Pyx_INCREF(__pyx_t_5);
12454  #else
12455  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
12456  __Pyx_GOTREF(__pyx_t_4);
12457  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
12458  __Pyx_GOTREF(__pyx_t_5);
12459  #endif
12460  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12461  } else {
12462  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
12463  }
12464  __pyx_v_have_slices = __pyx_t_4;
12465  __pyx_t_4 = 0;
12466  __pyx_v_indices = __pyx_t_5;
12467  __pyx_t_5 = 0;
12468 
12469  /* "View.MemoryView":410
12470  *
12471  * cdef char *itemp
12472  * if have_slices: # <<<<<<<<<<<<<<
12473  * return memview_slice(self, indices)
12474  * else:
12475  */
12476  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
12477  if (__pyx_t_2) {
12478 
12479  /* "View.MemoryView":411
12480  * cdef char *itemp
12481  * if have_slices:
12482  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
12483  * else:
12484  * itemp = self.get_item_pointer(indices)
12485  */
12486  __Pyx_XDECREF(__pyx_r);
12487  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
12488  __Pyx_GOTREF(__pyx_t_3);
12489  __pyx_r = __pyx_t_3;
12490  __pyx_t_3 = 0;
12491  goto __pyx_L0;
12492 
12493  /* "View.MemoryView":410
12494  *
12495  * cdef char *itemp
12496  * if have_slices: # <<<<<<<<<<<<<<
12497  * return memview_slice(self, indices)
12498  * else:
12499  */
12500  }
12501 
12502  /* "View.MemoryView":413
12503  * return memview_slice(self, indices)
12504  * else:
12505  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
12506  * return self.convert_item_to_object(itemp)
12507  *
12508  */
12509  /*else*/ {
12510  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
12511  __pyx_v_itemp = __pyx_t_6;
12512 
12513  /* "View.MemoryView":414
12514  * else:
12515  * itemp = self.get_item_pointer(indices)
12516  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
12517  *
12518  * def __setitem__(memoryview self, object index, object value):
12519  */
12520  __Pyx_XDECREF(__pyx_r);
12521  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
12522  __Pyx_GOTREF(__pyx_t_3);
12523  __pyx_r = __pyx_t_3;
12524  __pyx_t_3 = 0;
12525  goto __pyx_L0;
12526  }
12527 
12528  /* "View.MemoryView":403
12529  *
12530  *
12531  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
12532  * if index is Ellipsis:
12533  * return self
12534  */
12535 
12536  /* function exit code */
12537  __pyx_L1_error:;
12538  __Pyx_XDECREF(__pyx_t_3);
12539  __Pyx_XDECREF(__pyx_t_4);
12540  __Pyx_XDECREF(__pyx_t_5);
12541  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12542  __pyx_r = NULL;
12543  __pyx_L0:;
12544  __Pyx_XDECREF(__pyx_v_have_slices);
12545  __Pyx_XDECREF(__pyx_v_indices);
12546  __Pyx_XGIVEREF(__pyx_r);
12547  __Pyx_RefNannyFinishContext();
12548  return __pyx_r;
12549 }
12550 
12551 /* "View.MemoryView":416
12552  * return self.convert_item_to_object(itemp)
12553  *
12554  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
12555  * if self.view.readonly:
12556  * raise TypeError("Cannot assign to read-only memoryview")
12557  */
12558 
12559 /* Python wrapper */
12560 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
12561 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12562  int __pyx_r;
12563  __Pyx_RefNannyDeclarations
12564  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
12565  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
12566 
12567  /* function exit code */
12568  __Pyx_RefNannyFinishContext();
12569  return __pyx_r;
12570 }
12571 
12572 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12573  PyObject *__pyx_v_have_slices = NULL;
12574  PyObject *__pyx_v_obj = NULL;
12575  int __pyx_r;
12576  __Pyx_RefNannyDeclarations
12577  int __pyx_t_1;
12578  PyObject *__pyx_t_2 = NULL;
12579  PyObject *__pyx_t_3 = NULL;
12580  PyObject *__pyx_t_4 = NULL;
12581  __Pyx_RefNannySetupContext("__setitem__", 0);
12582  __Pyx_INCREF(__pyx_v_index);
12583 
12584  /* "View.MemoryView":417
12585  *
12586  * def __setitem__(memoryview self, object index, object value):
12587  * if self.view.readonly: # <<<<<<<<<<<<<<
12588  * raise TypeError("Cannot assign to read-only memoryview")
12589  *
12590  */
12591  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
12592  if (unlikely(__pyx_t_1)) {
12593 
12594  /* "View.MemoryView":418
12595  * def __setitem__(memoryview self, object index, object value):
12596  * if self.view.readonly:
12597  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
12598  *
12599  * have_slices, index = _unellipsify(index, self.view.ndim)
12600  */
12601  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
12602  __Pyx_GOTREF(__pyx_t_2);
12603  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12604  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12605  __PYX_ERR(1, 418, __pyx_L1_error)
12606 
12607  /* "View.MemoryView":417
12608  *
12609  * def __setitem__(memoryview self, object index, object value):
12610  * if self.view.readonly: # <<<<<<<<<<<<<<
12611  * raise TypeError("Cannot assign to read-only memoryview")
12612  *
12613  */
12614  }
12615 
12616  /* "View.MemoryView":420
12617  * raise TypeError("Cannot assign to read-only memoryview")
12618  *
12619  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
12620  *
12621  * if have_slices:
12622  */
12623  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
12624  __Pyx_GOTREF(__pyx_t_2);
12625  if (likely(__pyx_t_2 != Py_None)) {
12626  PyObject* sequence = __pyx_t_2;
12627  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12628  if (unlikely(size != 2)) {
12629  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12630  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12631  __PYX_ERR(1, 420, __pyx_L1_error)
12632  }
12633  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12634  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
12635  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
12636  __Pyx_INCREF(__pyx_t_3);
12637  __Pyx_INCREF(__pyx_t_4);
12638  #else
12639  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
12640  __Pyx_GOTREF(__pyx_t_3);
12641  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
12642  __Pyx_GOTREF(__pyx_t_4);
12643  #endif
12644  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12645  } else {
12646  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
12647  }
12648  __pyx_v_have_slices = __pyx_t_3;
12649  __pyx_t_3 = 0;
12650  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
12651  __pyx_t_4 = 0;
12652 
12653  /* "View.MemoryView":422
12654  * have_slices, index = _unellipsify(index, self.view.ndim)
12655  *
12656  * if have_slices: # <<<<<<<<<<<<<<
12657  * obj = self.is_slice(value)
12658  * if obj:
12659  */
12660  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
12661  if (__pyx_t_1) {
12662 
12663  /* "View.MemoryView":423
12664  *
12665  * if have_slices:
12666  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
12667  * if obj:
12668  * self.setitem_slice_assignment(self[index], obj)
12669  */
12670  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
12671  __Pyx_GOTREF(__pyx_t_2);
12672  __pyx_v_obj = __pyx_t_2;
12673  __pyx_t_2 = 0;
12674 
12675  /* "View.MemoryView":424
12676  * if have_slices:
12677  * obj = self.is_slice(value)
12678  * if obj: # <<<<<<<<<<<<<<
12679  * self.setitem_slice_assignment(self[index], obj)
12680  * else:
12681  */
12682  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
12683  if (__pyx_t_1) {
12684 
12685  /* "View.MemoryView":425
12686  * obj = self.is_slice(value)
12687  * if obj:
12688  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
12689  * else:
12690  * self.setitem_slice_assign_scalar(self[index], value)
12691  */
12692  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
12693  __Pyx_GOTREF(__pyx_t_2);
12694  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
12695  __Pyx_GOTREF(__pyx_t_4);
12696  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12697  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12698 
12699  /* "View.MemoryView":424
12700  * if have_slices:
12701  * obj = self.is_slice(value)
12702  * if obj: # <<<<<<<<<<<<<<
12703  * self.setitem_slice_assignment(self[index], obj)
12704  * else:
12705  */
12706  goto __pyx_L5;
12707  }
12708 
12709  /* "View.MemoryView":427
12710  * self.setitem_slice_assignment(self[index], obj)
12711  * else:
12712  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
12713  * else:
12714  * self.setitem_indexed(index, value)
12715  */
12716  /*else*/ {
12717  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
12718  __Pyx_GOTREF(__pyx_t_4);
12719  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
12720  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
12721  __Pyx_GOTREF(__pyx_t_2);
12722  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12723  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12724  }
12725  __pyx_L5:;
12726 
12727  /* "View.MemoryView":422
12728  * have_slices, index = _unellipsify(index, self.view.ndim)
12729  *
12730  * if have_slices: # <<<<<<<<<<<<<<
12731  * obj = self.is_slice(value)
12732  * if obj:
12733  */
12734  goto __pyx_L4;
12735  }
12736 
12737  /* "View.MemoryView":429
12738  * self.setitem_slice_assign_scalar(self[index], value)
12739  * else:
12740  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
12741  *
12742  * cdef is_slice(self, obj):
12743  */
12744  /*else*/ {
12745  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
12746  __Pyx_GOTREF(__pyx_t_2);
12747  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12748  }
12749  __pyx_L4:;
12750 
12751  /* "View.MemoryView":416
12752  * return self.convert_item_to_object(itemp)
12753  *
12754  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
12755  * if self.view.readonly:
12756  * raise TypeError("Cannot assign to read-only memoryview")
12757  */
12758 
12759  /* function exit code */
12760  __pyx_r = 0;
12761  goto __pyx_L0;
12762  __pyx_L1_error:;
12763  __Pyx_XDECREF(__pyx_t_2);
12764  __Pyx_XDECREF(__pyx_t_3);
12765  __Pyx_XDECREF(__pyx_t_4);
12766  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12767  __pyx_r = -1;
12768  __pyx_L0:;
12769  __Pyx_XDECREF(__pyx_v_have_slices);
12770  __Pyx_XDECREF(__pyx_v_obj);
12771  __Pyx_XDECREF(__pyx_v_index);
12772  __Pyx_RefNannyFinishContext();
12773  return __pyx_r;
12774 }
12775 
12776 /* "View.MemoryView":431
12777  * self.setitem_indexed(index, value)
12778  *
12779  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12780  * if not isinstance(obj, memoryview):
12781  * try:
12782  */
12783 
12784 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
12785  PyObject *__pyx_r = NULL;
12786  __Pyx_RefNannyDeclarations
12787  int __pyx_t_1;
12788  int __pyx_t_2;
12789  PyObject *__pyx_t_3 = NULL;
12790  PyObject *__pyx_t_4 = NULL;
12791  PyObject *__pyx_t_5 = NULL;
12792  PyObject *__pyx_t_6 = NULL;
12793  PyObject *__pyx_t_7 = NULL;
12794  PyObject *__pyx_t_8 = NULL;
12795  int __pyx_t_9;
12796  __Pyx_RefNannySetupContext("is_slice", 0);
12797  __Pyx_INCREF(__pyx_v_obj);
12798 
12799  /* "View.MemoryView":432
12800  *
12801  * cdef is_slice(self, obj):
12802  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12803  * try:
12804  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12805  */
12806  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
12807  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
12808  if (__pyx_t_2) {
12809 
12810  /* "View.MemoryView":433
12811  * cdef is_slice(self, obj):
12812  * if not isinstance(obj, memoryview):
12813  * try: # <<<<<<<<<<<<<<
12814  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12815  * self.dtype_is_object)
12816  */
12817  {
12818  __Pyx_PyThreadState_declare
12819  __Pyx_PyThreadState_assign
12820  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
12821  __Pyx_XGOTREF(__pyx_t_3);
12822  __Pyx_XGOTREF(__pyx_t_4);
12823  __Pyx_XGOTREF(__pyx_t_5);
12824  /*try:*/ {
12825 
12826  /* "View.MemoryView":434
12827  * if not isinstance(obj, memoryview):
12828  * try:
12829  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
12830  * self.dtype_is_object)
12831  * except TypeError:
12832  */
12833  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
12834  __Pyx_GOTREF(__pyx_t_6);
12835 
12836  /* "View.MemoryView":435
12837  * try:
12838  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12839  * self.dtype_is_object) # <<<<<<<<<<<<<<
12840  * except TypeError:
12841  * return None
12842  */
12843  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
12844  __Pyx_GOTREF(__pyx_t_7);
12845 
12846  /* "View.MemoryView":434
12847  * if not isinstance(obj, memoryview):
12848  * try:
12849  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
12850  * self.dtype_is_object)
12851  * except TypeError:
12852  */
12853  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
12854  __Pyx_GOTREF(__pyx_t_8);
12855  __Pyx_INCREF(__pyx_v_obj);
12856  __Pyx_GIVEREF(__pyx_v_obj);
12857  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
12858  __Pyx_GIVEREF(__pyx_t_6);
12859  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
12860  __Pyx_GIVEREF(__pyx_t_7);
12861  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
12862  __pyx_t_6 = 0;
12863  __pyx_t_7 = 0;
12864  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
12865  __Pyx_GOTREF(__pyx_t_7);
12866  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12867  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
12868  __pyx_t_7 = 0;
12869 
12870  /* "View.MemoryView":433
12871  * cdef is_slice(self, obj):
12872  * if not isinstance(obj, memoryview):
12873  * try: # <<<<<<<<<<<<<<
12874  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12875  * self.dtype_is_object)
12876  */
12877  }
12878  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12879  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12880  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12881  goto __pyx_L9_try_end;
12882  __pyx_L4_error:;
12883  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12884  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12885  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12886 
12887  /* "View.MemoryView":436
12888  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12889  * self.dtype_is_object)
12890  * except TypeError: # <<<<<<<<<<<<<<
12891  * return None
12892  *
12893  */
12894  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
12895  if (__pyx_t_9) {
12896  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12897  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
12898  __Pyx_GOTREF(__pyx_t_7);
12899  __Pyx_GOTREF(__pyx_t_8);
12900  __Pyx_GOTREF(__pyx_t_6);
12901 
12902  /* "View.MemoryView":437
12903  * self.dtype_is_object)
12904  * except TypeError:
12905  * return None # <<<<<<<<<<<<<<
12906  *
12907  * return obj
12908  */
12909  __Pyx_XDECREF(__pyx_r);
12910  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12911  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12912  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12913  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12914  goto __pyx_L7_except_return;
12915  }
12916  goto __pyx_L6_except_error;
12917  __pyx_L6_except_error:;
12918 
12919  /* "View.MemoryView":433
12920  * cdef is_slice(self, obj):
12921  * if not isinstance(obj, memoryview):
12922  * try: # <<<<<<<<<<<<<<
12923  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12924  * self.dtype_is_object)
12925  */
12926  __Pyx_XGIVEREF(__pyx_t_3);
12927  __Pyx_XGIVEREF(__pyx_t_4);
12928  __Pyx_XGIVEREF(__pyx_t_5);
12929  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12930  goto __pyx_L1_error;
12931  __pyx_L7_except_return:;
12932  __Pyx_XGIVEREF(__pyx_t_3);
12933  __Pyx_XGIVEREF(__pyx_t_4);
12934  __Pyx_XGIVEREF(__pyx_t_5);
12935  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12936  goto __pyx_L0;
12937  __pyx_L9_try_end:;
12938  }
12939 
12940  /* "View.MemoryView":432
12941  *
12942  * cdef is_slice(self, obj):
12943  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12944  * try:
12945  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12946  */
12947  }
12948 
12949  /* "View.MemoryView":439
12950  * return None
12951  *
12952  * return obj # <<<<<<<<<<<<<<
12953  *
12954  * cdef setitem_slice_assignment(self, dst, src):
12955  */
12956  __Pyx_XDECREF(__pyx_r);
12957  __Pyx_INCREF(__pyx_v_obj);
12958  __pyx_r = __pyx_v_obj;
12959  goto __pyx_L0;
12960 
12961  /* "View.MemoryView":431
12962  * self.setitem_indexed(index, value)
12963  *
12964  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12965  * if not isinstance(obj, memoryview):
12966  * try:
12967  */
12968 
12969  /* function exit code */
12970  __pyx_L1_error:;
12971  __Pyx_XDECREF(__pyx_t_6);
12972  __Pyx_XDECREF(__pyx_t_7);
12973  __Pyx_XDECREF(__pyx_t_8);
12974  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12975  __pyx_r = 0;
12976  __pyx_L0:;
12977  __Pyx_XDECREF(__pyx_v_obj);
12978  __Pyx_XGIVEREF(__pyx_r);
12979  __Pyx_RefNannyFinishContext();
12980  return __pyx_r;
12981 }
12982 
12983 /* "View.MemoryView":441
12984  * return obj
12985  *
12986  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12987  * cdef __Pyx_memviewslice dst_slice
12988  * cdef __Pyx_memviewslice src_slice
12989  */
12990 
12991 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12992  __Pyx_memviewslice __pyx_v_dst_slice;
12993  __Pyx_memviewslice __pyx_v_src_slice;
12994  PyObject *__pyx_r = NULL;
12995  __Pyx_RefNannyDeclarations
12996  __Pyx_memviewslice *__pyx_t_1;
12997  __Pyx_memviewslice *__pyx_t_2;
12998  PyObject *__pyx_t_3 = NULL;
12999  int __pyx_t_4;
13000  int __pyx_t_5;
13001  int __pyx_t_6;
13002  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
13003 
13004  /* "View.MemoryView":445
13005  * cdef __Pyx_memviewslice src_slice
13006  *
13007  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
13008  * get_slice_from_memview(dst, &dst_slice)[0],
13009  * src.ndim, dst.ndim, self.dtype_is_object)
13010  */
13011  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
13012  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
13013 
13014  /* "View.MemoryView":446
13015  *
13016  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
13017  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
13018  * src.ndim, dst.ndim, self.dtype_is_object)
13019  *
13020  */
13021  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
13022  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
13023 
13024  /* "View.MemoryView":447
13025  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
13026  * get_slice_from_memview(dst, &dst_slice)[0],
13027  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
13028  *
13029  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
13030  */
13031  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
13032  __Pyx_GOTREF(__pyx_t_3);
13033  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
13034  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13035  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
13036  __Pyx_GOTREF(__pyx_t_3);
13037  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
13038  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13039 
13040  /* "View.MemoryView":445
13041  * cdef __Pyx_memviewslice src_slice
13042  *
13043  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
13044  * get_slice_from_memview(dst, &dst_slice)[0],
13045  * src.ndim, dst.ndim, self.dtype_is_object)
13046  */
13047  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
13048 
13049  /* "View.MemoryView":441
13050  * return obj
13051  *
13052  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
13053  * cdef __Pyx_memviewslice dst_slice
13054  * cdef __Pyx_memviewslice src_slice
13055  */
13056 
13057  /* function exit code */
13058  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13059  goto __pyx_L0;
13060  __pyx_L1_error:;
13061  __Pyx_XDECREF(__pyx_t_3);
13062  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
13063  __pyx_r = 0;
13064  __pyx_L0:;
13065  __Pyx_XGIVEREF(__pyx_r);
13066  __Pyx_RefNannyFinishContext();
13067  return __pyx_r;
13068 }
13069 
13070 /* "View.MemoryView":449
13071  * src.ndim, dst.ndim, self.dtype_is_object)
13072  *
13073  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
13074  * cdef int array[128]
13075  * cdef void *tmp = NULL
13076  */
13077 
13078 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
13079  int __pyx_v_array[0x80];
13080  void *__pyx_v_tmp;
13081  void *__pyx_v_item;
13082  __Pyx_memviewslice *__pyx_v_dst_slice;
13083  __Pyx_memviewslice __pyx_v_tmp_slice;
13084  PyObject *__pyx_r = NULL;
13085  __Pyx_RefNannyDeclarations
13086  __Pyx_memviewslice *__pyx_t_1;
13087  int __pyx_t_2;
13088  PyObject *__pyx_t_3 = NULL;
13089  int __pyx_t_4;
13090  int __pyx_t_5;
13091  char const *__pyx_t_6;
13092  PyObject *__pyx_t_7 = NULL;
13093  PyObject *__pyx_t_8 = NULL;
13094  PyObject *__pyx_t_9 = NULL;
13095  PyObject *__pyx_t_10 = NULL;
13096  PyObject *__pyx_t_11 = NULL;
13097  PyObject *__pyx_t_12 = NULL;
13098  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
13099 
13100  /* "View.MemoryView":451
13101  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
13102  * cdef int array[128]
13103  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
13104  * cdef void *item
13105  *
13106  */
13107  __pyx_v_tmp = NULL;
13108 
13109  /* "View.MemoryView":456
13110  * cdef __Pyx_memviewslice *dst_slice
13111  * cdef __Pyx_memviewslice tmp_slice
13112  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
13113  *
13114  * if <size_t>self.view.itemsize > sizeof(array):
13115  */
13116  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
13117  __pyx_v_dst_slice = __pyx_t_1;
13118 
13119  /* "View.MemoryView":458
13120  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
13121  *
13122  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
13123  * tmp = PyMem_Malloc(self.view.itemsize)
13124  * if tmp == NULL:
13125  */
13126  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
13127  if (__pyx_t_2) {
13128 
13129  /* "View.MemoryView":459
13130  *
13131  * if <size_t>self.view.itemsize > sizeof(array):
13132  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
13133  * if tmp == NULL:
13134  * raise MemoryError
13135  */
13136  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
13137 
13138  /* "View.MemoryView":460
13139  * if <size_t>self.view.itemsize > sizeof(array):
13140  * tmp = PyMem_Malloc(self.view.itemsize)
13141  * if tmp == NULL: # <<<<<<<<<<<<<<
13142  * raise MemoryError
13143  * item = tmp
13144  */
13145  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
13146  if (unlikely(__pyx_t_2)) {
13147 
13148  /* "View.MemoryView":461
13149  * tmp = PyMem_Malloc(self.view.itemsize)
13150  * if tmp == NULL:
13151  * raise MemoryError # <<<<<<<<<<<<<<
13152  * item = tmp
13153  * else:
13154  */
13155  PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
13156 
13157  /* "View.MemoryView":460
13158  * if <size_t>self.view.itemsize > sizeof(array):
13159  * tmp = PyMem_Malloc(self.view.itemsize)
13160  * if tmp == NULL: # <<<<<<<<<<<<<<
13161  * raise MemoryError
13162  * item = tmp
13163  */
13164  }
13165 
13166  /* "View.MemoryView":462
13167  * if tmp == NULL:
13168  * raise MemoryError
13169  * item = tmp # <<<<<<<<<<<<<<
13170  * else:
13171  * item = <void *> array
13172  */
13173  __pyx_v_item = __pyx_v_tmp;
13174 
13175  /* "View.MemoryView":458
13176  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
13177  *
13178  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
13179  * tmp = PyMem_Malloc(self.view.itemsize)
13180  * if tmp == NULL:
13181  */
13182  goto __pyx_L3;
13183  }
13184 
13185  /* "View.MemoryView":464
13186  * item = tmp
13187  * else:
13188  * item = <void *> array # <<<<<<<<<<<<<<
13189  *
13190  * try:
13191  */
13192  /*else*/ {
13193  __pyx_v_item = ((void *)__pyx_v_array);
13194  }
13195  __pyx_L3:;
13196 
13197  /* "View.MemoryView":466
13198  * item = <void *> array
13199  *
13200  * try: # <<<<<<<<<<<<<<
13201  * if self.dtype_is_object:
13202  * (<PyObject **> item)[0] = <PyObject *> value
13203  */
13204  /*try:*/ {
13205 
13206  /* "View.MemoryView":467
13207  *
13208  * try:
13209  * if self.dtype_is_object: # <<<<<<<<<<<<<<
13210  * (<PyObject **> item)[0] = <PyObject *> value
13211  * else:
13212  */
13213  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
13214  if (__pyx_t_2) {
13215 
13216  /* "View.MemoryView":468
13217  * try:
13218  * if self.dtype_is_object:
13219  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
13220  * else:
13221  * self.assign_item_from_object(<char *> item, value)
13222  */
13223  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
13224 
13225  /* "View.MemoryView":467
13226  *
13227  * try:
13228  * if self.dtype_is_object: # <<<<<<<<<<<<<<
13229  * (<PyObject **> item)[0] = <PyObject *> value
13230  * else:
13231  */
13232  goto __pyx_L8;
13233  }
13234 
13235  /* "View.MemoryView":470
13236  * (<PyObject **> item)[0] = <PyObject *> value
13237  * else:
13238  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
13239  *
13240  *
13241  */
13242  /*else*/ {
13243  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
13244  __Pyx_GOTREF(__pyx_t_3);
13245  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13246  }
13247  __pyx_L8:;
13248 
13249  /* "View.MemoryView":474
13250  *
13251  *
13252  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
13253  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
13254  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
13255  */
13256  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
13257  if (__pyx_t_2) {
13258 
13259  /* "View.MemoryView":475
13260  *
13261  * if self.view.suboffsets != NULL:
13262  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
13263  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
13264  * item, self.dtype_is_object)
13265  */
13266  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
13267  __Pyx_GOTREF(__pyx_t_3);
13268  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13269 
13270  /* "View.MemoryView":474
13271  *
13272  *
13273  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
13274  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
13275  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
13276  */
13277  }
13278 
13279  /* "View.MemoryView":476
13280  * if self.view.suboffsets != NULL:
13281  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
13282  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
13283  * item, self.dtype_is_object)
13284  * finally:
13285  */
13286  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
13287  }
13288 
13289  /* "View.MemoryView":479
13290  * item, self.dtype_is_object)
13291  * finally:
13292  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
13293  *
13294  * cdef setitem_indexed(self, index, value):
13295  */
13296  /*finally:*/ {
13297  /*normal exit:*/{
13298  PyMem_Free(__pyx_v_tmp);
13299  goto __pyx_L7;
13300  }
13301  __pyx_L6_error:;
13302  /*exception exit:*/{
13303  __Pyx_PyThreadState_declare
13304  __Pyx_PyThreadState_assign
13305  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
13306  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13307  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
13308  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
13309  __Pyx_XGOTREF(__pyx_t_7);
13310  __Pyx_XGOTREF(__pyx_t_8);
13311  __Pyx_XGOTREF(__pyx_t_9);
13312  __Pyx_XGOTREF(__pyx_t_10);
13313  __Pyx_XGOTREF(__pyx_t_11);
13314  __Pyx_XGOTREF(__pyx_t_12);
13315  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
13316  {
13317  PyMem_Free(__pyx_v_tmp);
13318  }
13319  if (PY_MAJOR_VERSION >= 3) {
13320  __Pyx_XGIVEREF(__pyx_t_10);
13321  __Pyx_XGIVEREF(__pyx_t_11);
13322  __Pyx_XGIVEREF(__pyx_t_12);
13323  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
13324  }
13325  __Pyx_XGIVEREF(__pyx_t_7);
13326  __Pyx_XGIVEREF(__pyx_t_8);
13327  __Pyx_XGIVEREF(__pyx_t_9);
13328  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
13329  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
13330  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
13331  goto __pyx_L1_error;
13332  }
13333  __pyx_L7:;
13334  }
13335 
13336  /* "View.MemoryView":449
13337  * src.ndim, dst.ndim, self.dtype_is_object)
13338  *
13339  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
13340  * cdef int array[128]
13341  * cdef void *tmp = NULL
13342  */
13343 
13344  /* function exit code */
13345  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13346  goto __pyx_L0;
13347  __pyx_L1_error:;
13348  __Pyx_XDECREF(__pyx_t_3);
13349  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
13350  __pyx_r = 0;
13351  __pyx_L0:;
13352  __Pyx_XGIVEREF(__pyx_r);
13353  __Pyx_RefNannyFinishContext();
13354  return __pyx_r;
13355 }
13356 
13357 /* "View.MemoryView":481
13358  * PyMem_Free(tmp)
13359  *
13360  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
13361  * cdef char *itemp = self.get_item_pointer(index)
13362  * self.assign_item_from_object(itemp, value)
13363  */
13364 
13365 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
13366  char *__pyx_v_itemp;
13367  PyObject *__pyx_r = NULL;
13368  __Pyx_RefNannyDeclarations
13369  char *__pyx_t_1;
13370  PyObject *__pyx_t_2 = NULL;
13371  __Pyx_RefNannySetupContext("setitem_indexed", 0);
13372 
13373  /* "View.MemoryView":482
13374  *
13375  * cdef setitem_indexed(self, index, value):
13376  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
13377  * self.assign_item_from_object(itemp, value)
13378  *
13379  */
13380  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
13381  __pyx_v_itemp = __pyx_t_1;
13382 
13383  /* "View.MemoryView":483
13384  * cdef setitem_indexed(self, index, value):
13385  * cdef char *itemp = self.get_item_pointer(index)
13386  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
13387  *
13388  * cdef convert_item_to_object(self, char *itemp):
13389  */
13390  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
13391  __Pyx_GOTREF(__pyx_t_2);
13392  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13393 
13394  /* "View.MemoryView":481
13395  * PyMem_Free(tmp)
13396  *
13397  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
13398  * cdef char *itemp = self.get_item_pointer(index)
13399  * self.assign_item_from_object(itemp, value)
13400  */
13401 
13402  /* function exit code */
13403  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13404  goto __pyx_L0;
13405  __pyx_L1_error:;
13406  __Pyx_XDECREF(__pyx_t_2);
13407  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
13408  __pyx_r = 0;
13409  __pyx_L0:;
13410  __Pyx_XGIVEREF(__pyx_r);
13411  __Pyx_RefNannyFinishContext();
13412  return __pyx_r;
13413 }
13414 
13415 /* "View.MemoryView":485
13416  * self.assign_item_from_object(itemp, value)
13417  *
13418  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
13419  * """Only used if instantiated manually by the user, or if Cython doesn't
13420  * know how to convert the type"""
13421  */
13422 
13423 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
13424  PyObject *__pyx_v_struct = NULL;
13425  PyObject *__pyx_v_bytesitem = 0;
13426  PyObject *__pyx_v_result = NULL;
13427  PyObject *__pyx_r = NULL;
13428  __Pyx_RefNannyDeclarations
13429  PyObject *__pyx_t_1 = NULL;
13430  PyObject *__pyx_t_2 = NULL;
13431  PyObject *__pyx_t_3 = NULL;
13432  PyObject *__pyx_t_4 = NULL;
13433  PyObject *__pyx_t_5 = NULL;
13434  PyObject *__pyx_t_6 = NULL;
13435  PyObject *__pyx_t_7 = NULL;
13436  int __pyx_t_8;
13437  PyObject *__pyx_t_9 = NULL;
13438  size_t __pyx_t_10;
13439  int __pyx_t_11;
13440  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
13441 
13442  /* "View.MemoryView":488
13443  * """Only used if instantiated manually by the user, or if Cython doesn't
13444  * know how to convert the type"""
13445  * import struct # <<<<<<<<<<<<<<
13446  * cdef bytes bytesitem
13447  *
13448  */
13449  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
13450  __Pyx_GOTREF(__pyx_t_1);
13451  __pyx_v_struct = __pyx_t_1;
13452  __pyx_t_1 = 0;
13453 
13454  /* "View.MemoryView":491
13455  * cdef bytes bytesitem
13456  *
13457  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
13458  * try:
13459  * result = struct.unpack(self.view.format, bytesitem)
13460  */
13461  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
13462  __Pyx_GOTREF(__pyx_t_1);
13463  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
13464  __pyx_t_1 = 0;
13465 
13466  /* "View.MemoryView":492
13467  *
13468  * bytesitem = itemp[:self.view.itemsize]
13469  * try: # <<<<<<<<<<<<<<
13470  * result = struct.unpack(self.view.format, bytesitem)
13471  * except struct.error:
13472  */
13473  {
13474  __Pyx_PyThreadState_declare
13475  __Pyx_PyThreadState_assign
13476  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
13477  __Pyx_XGOTREF(__pyx_t_2);
13478  __Pyx_XGOTREF(__pyx_t_3);
13479  __Pyx_XGOTREF(__pyx_t_4);
13480  /*try:*/ {
13481 
13482  /* "View.MemoryView":493
13483  * bytesitem = itemp[:self.view.itemsize]
13484  * try:
13485  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
13486  * except struct.error:
13487  * raise ValueError("Unable to convert item to object")
13488  */
13489  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
13490  __Pyx_GOTREF(__pyx_t_5);
13491  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
13492  __Pyx_GOTREF(__pyx_t_6);
13493  __pyx_t_7 = NULL;
13494  __pyx_t_8 = 0;
13495  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
13496  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
13497  if (likely(__pyx_t_7)) {
13498  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
13499  __Pyx_INCREF(__pyx_t_7);
13500  __Pyx_INCREF(function);
13501  __Pyx_DECREF_SET(__pyx_t_5, function);
13502  __pyx_t_8 = 1;
13503  }
13504  }
13505  #if CYTHON_FAST_PYCALL
13506  if (PyFunction_Check(__pyx_t_5)) {
13507  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13508  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
13509  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13510  __Pyx_GOTREF(__pyx_t_1);
13511  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13512  } else
13513  #endif
13514  #if CYTHON_FAST_PYCCALL
13515  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
13516  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13517  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
13518  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13519  __Pyx_GOTREF(__pyx_t_1);
13520  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13521  } else
13522  #endif
13523  {
13524  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
13525  __Pyx_GOTREF(__pyx_t_9);
13526  if (__pyx_t_7) {
13527  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
13528  }
13529  __Pyx_GIVEREF(__pyx_t_6);
13530  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
13531  __Pyx_INCREF(__pyx_v_bytesitem);
13532  __Pyx_GIVEREF(__pyx_v_bytesitem);
13533  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
13534  __pyx_t_6 = 0;
13535  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
13536  __Pyx_GOTREF(__pyx_t_1);
13537  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13538  }
13539  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13540  __pyx_v_result = __pyx_t_1;
13541  __pyx_t_1 = 0;
13542 
13543  /* "View.MemoryView":492
13544  *
13545  * bytesitem = itemp[:self.view.itemsize]
13546  * try: # <<<<<<<<<<<<<<
13547  * result = struct.unpack(self.view.format, bytesitem)
13548  * except struct.error:
13549  */
13550  }
13551 
13552  /* "View.MemoryView":497
13553  * raise ValueError("Unable to convert item to object")
13554  * else:
13555  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
13556  * return result[0]
13557  * return result
13558  */
13559  /*else:*/ {
13560  __pyx_t_10 = strlen(__pyx_v_self->view.format);
13561  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
13562  if (__pyx_t_11) {
13563 
13564  /* "View.MemoryView":498
13565  * else:
13566  * if len(self.view.format) == 1:
13567  * return result[0] # <<<<<<<<<<<<<<
13568  * return result
13569  *
13570  */
13571  __Pyx_XDECREF(__pyx_r);
13572  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
13573  __Pyx_GOTREF(__pyx_t_1);
13574  __pyx_r = __pyx_t_1;
13575  __pyx_t_1 = 0;
13576  goto __pyx_L6_except_return;
13577 
13578  /* "View.MemoryView":497
13579  * raise ValueError("Unable to convert item to object")
13580  * else:
13581  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
13582  * return result[0]
13583  * return result
13584  */
13585  }
13586 
13587  /* "View.MemoryView":499
13588  * if len(self.view.format) == 1:
13589  * return result[0]
13590  * return result # <<<<<<<<<<<<<<
13591  *
13592  * cdef assign_item_from_object(self, char *itemp, object value):
13593  */
13594  __Pyx_XDECREF(__pyx_r);
13595  __Pyx_INCREF(__pyx_v_result);
13596  __pyx_r = __pyx_v_result;
13597  goto __pyx_L6_except_return;
13598  }
13599  __pyx_L3_error:;
13600  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13601  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13602  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13603  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13604  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13605 
13606  /* "View.MemoryView":494
13607  * try:
13608  * result = struct.unpack(self.view.format, bytesitem)
13609  * except struct.error: # <<<<<<<<<<<<<<
13610  * raise ValueError("Unable to convert item to object")
13611  * else:
13612  */
13613  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
13614  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
13615  __Pyx_GOTREF(__pyx_t_6);
13616  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
13617  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13618  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
13619  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
13620  if (__pyx_t_8) {
13621  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13622  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
13623  __Pyx_GOTREF(__pyx_t_9);
13624  __Pyx_GOTREF(__pyx_t_5);
13625  __Pyx_GOTREF(__pyx_t_1);
13626 
13627  /* "View.MemoryView":495
13628  * result = struct.unpack(self.view.format, bytesitem)
13629  * except struct.error:
13630  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
13631  * else:
13632  * if len(self.view.format) == 1:
13633  */
13634  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
13635  __Pyx_GOTREF(__pyx_t_6);
13636  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
13637  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13638  __PYX_ERR(1, 495, __pyx_L5_except_error)
13639  }
13640  goto __pyx_L5_except_error;
13641  __pyx_L5_except_error:;
13642 
13643  /* "View.MemoryView":492
13644  *
13645  * bytesitem = itemp[:self.view.itemsize]
13646  * try: # <<<<<<<<<<<<<<
13647  * result = struct.unpack(self.view.format, bytesitem)
13648  * except struct.error:
13649  */
13650  __Pyx_XGIVEREF(__pyx_t_2);
13651  __Pyx_XGIVEREF(__pyx_t_3);
13652  __Pyx_XGIVEREF(__pyx_t_4);
13653  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13654  goto __pyx_L1_error;
13655  __pyx_L6_except_return:;
13656  __Pyx_XGIVEREF(__pyx_t_2);
13657  __Pyx_XGIVEREF(__pyx_t_3);
13658  __Pyx_XGIVEREF(__pyx_t_4);
13659  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13660  goto __pyx_L0;
13661  }
13662 
13663  /* "View.MemoryView":485
13664  * self.assign_item_from_object(itemp, value)
13665  *
13666  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
13667  * """Only used if instantiated manually by the user, or if Cython doesn't
13668  * know how to convert the type"""
13669  */
13670 
13671  /* function exit code */
13672  __pyx_L1_error:;
13673  __Pyx_XDECREF(__pyx_t_1);
13674  __Pyx_XDECREF(__pyx_t_5);
13675  __Pyx_XDECREF(__pyx_t_6);
13676  __Pyx_XDECREF(__pyx_t_7);
13677  __Pyx_XDECREF(__pyx_t_9);
13678  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13679  __pyx_r = 0;
13680  __pyx_L0:;
13681  __Pyx_XDECREF(__pyx_v_struct);
13682  __Pyx_XDECREF(__pyx_v_bytesitem);
13683  __Pyx_XDECREF(__pyx_v_result);
13684  __Pyx_XGIVEREF(__pyx_r);
13685  __Pyx_RefNannyFinishContext();
13686  return __pyx_r;
13687 }
13688 
13689 /* "View.MemoryView":501
13690  * return result
13691  *
13692  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
13693  * """Only used if instantiated manually by the user, or if Cython doesn't
13694  * know how to convert the type"""
13695  */
13696 
13697 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
13698  PyObject *__pyx_v_struct = NULL;
13699  char __pyx_v_c;
13700  PyObject *__pyx_v_bytesvalue = 0;
13701  Py_ssize_t __pyx_v_i;
13702  PyObject *__pyx_r = NULL;
13703  __Pyx_RefNannyDeclarations
13704  PyObject *__pyx_t_1 = NULL;
13705  int __pyx_t_2;
13706  int __pyx_t_3;
13707  PyObject *__pyx_t_4 = NULL;
13708  PyObject *__pyx_t_5 = NULL;
13709  PyObject *__pyx_t_6 = NULL;
13710  int __pyx_t_7;
13711  PyObject *__pyx_t_8 = NULL;
13712  Py_ssize_t __pyx_t_9;
13713  PyObject *__pyx_t_10 = NULL;
13714  char *__pyx_t_11;
13715  char *__pyx_t_12;
13716  char *__pyx_t_13;
13717  char *__pyx_t_14;
13718  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
13719 
13720  /* "View.MemoryView":504
13721  * """Only used if instantiated manually by the user, or if Cython doesn't
13722  * know how to convert the type"""
13723  * import struct # <<<<<<<<<<<<<<
13724  * cdef char c
13725  * cdef bytes bytesvalue
13726  */
13727  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
13728  __Pyx_GOTREF(__pyx_t_1);
13729  __pyx_v_struct = __pyx_t_1;
13730  __pyx_t_1 = 0;
13731 
13732  /* "View.MemoryView":509
13733  * cdef Py_ssize_t i
13734  *
13735  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
13736  * bytesvalue = struct.pack(self.view.format, *value)
13737  * else:
13738  */
13739  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
13740  __pyx_t_3 = (__pyx_t_2 != 0);
13741  if (__pyx_t_3) {
13742 
13743  /* "View.MemoryView":510
13744  *
13745  * if isinstance(value, tuple):
13746  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
13747  * else:
13748  * bytesvalue = struct.pack(self.view.format, value)
13749  */
13750  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
13751  __Pyx_GOTREF(__pyx_t_1);
13752  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
13753  __Pyx_GOTREF(__pyx_t_4);
13754  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
13755  __Pyx_GOTREF(__pyx_t_5);
13756  __Pyx_GIVEREF(__pyx_t_4);
13757  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
13758  __pyx_t_4 = 0;
13759  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
13760  __Pyx_GOTREF(__pyx_t_4);
13761  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
13762  __Pyx_GOTREF(__pyx_t_6);
13763  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13764  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13765  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
13766  __Pyx_GOTREF(__pyx_t_4);
13767  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13768  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13769  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
13770  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13771  __pyx_t_4 = 0;
13772 
13773  /* "View.MemoryView":509
13774  * cdef Py_ssize_t i
13775  *
13776  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
13777  * bytesvalue = struct.pack(self.view.format, *value)
13778  * else:
13779  */
13780  goto __pyx_L3;
13781  }
13782 
13783  /* "View.MemoryView":512
13784  * bytesvalue = struct.pack(self.view.format, *value)
13785  * else:
13786  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
13787  *
13788  * for i, c in enumerate(bytesvalue):
13789  */
13790  /*else*/ {
13791  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
13792  __Pyx_GOTREF(__pyx_t_6);
13793  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
13794  __Pyx_GOTREF(__pyx_t_1);
13795  __pyx_t_5 = NULL;
13796  __pyx_t_7 = 0;
13797  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
13798  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13799  if (likely(__pyx_t_5)) {
13800  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
13801  __Pyx_INCREF(__pyx_t_5);
13802  __Pyx_INCREF(function);
13803  __Pyx_DECREF_SET(__pyx_t_6, function);
13804  __pyx_t_7 = 1;
13805  }
13806  }
13807  #if CYTHON_FAST_PYCALL
13808  if (PyFunction_Check(__pyx_t_6)) {
13809  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13810  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
13811  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13812  __Pyx_GOTREF(__pyx_t_4);
13813  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13814  } else
13815  #endif
13816  #if CYTHON_FAST_PYCCALL
13817  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13818  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13819  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
13820  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13821  __Pyx_GOTREF(__pyx_t_4);
13822  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13823  } else
13824  #endif
13825  {
13826  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
13827  __Pyx_GOTREF(__pyx_t_8);
13828  if (__pyx_t_5) {
13829  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
13830  }
13831  __Pyx_GIVEREF(__pyx_t_1);
13832  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
13833  __Pyx_INCREF(__pyx_v_value);
13834  __Pyx_GIVEREF(__pyx_v_value);
13835  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
13836  __pyx_t_1 = 0;
13837  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
13838  __Pyx_GOTREF(__pyx_t_4);
13839  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13840  }
13841  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13842  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
13843  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13844  __pyx_t_4 = 0;
13845  }
13846  __pyx_L3:;
13847 
13848  /* "View.MemoryView":514
13849  * bytesvalue = struct.pack(self.view.format, value)
13850  *
13851  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
13852  * itemp[i] = c
13853  *
13854  */
13855  __pyx_t_9 = 0;
13856  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
13857  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
13858  __PYX_ERR(1, 514, __pyx_L1_error)
13859  }
13860  __Pyx_INCREF(__pyx_v_bytesvalue);
13861  __pyx_t_10 = __pyx_v_bytesvalue;
13862  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
13863  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
13864  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
13865  __pyx_t_11 = __pyx_t_14;
13866  __pyx_v_c = (__pyx_t_11[0]);
13867 
13868  /* "View.MemoryView":515
13869  *
13870  * for i, c in enumerate(bytesvalue):
13871  * itemp[i] = c # <<<<<<<<<<<<<<
13872  *
13873  * @cname('getbuffer')
13874  */
13875  __pyx_v_i = __pyx_t_9;
13876 
13877  /* "View.MemoryView":514
13878  * bytesvalue = struct.pack(self.view.format, value)
13879  *
13880  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
13881  * itemp[i] = c
13882  *
13883  */
13884  __pyx_t_9 = (__pyx_t_9 + 1);
13885 
13886  /* "View.MemoryView":515
13887  *
13888  * for i, c in enumerate(bytesvalue):
13889  * itemp[i] = c # <<<<<<<<<<<<<<
13890  *
13891  * @cname('getbuffer')
13892  */
13893  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
13894  }
13895  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13896 
13897  /* "View.MemoryView":501
13898  * return result
13899  *
13900  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
13901  * """Only used if instantiated manually by the user, or if Cython doesn't
13902  * know how to convert the type"""
13903  */
13904 
13905  /* function exit code */
13906  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13907  goto __pyx_L0;
13908  __pyx_L1_error:;
13909  __Pyx_XDECREF(__pyx_t_1);
13910  __Pyx_XDECREF(__pyx_t_4);
13911  __Pyx_XDECREF(__pyx_t_5);
13912  __Pyx_XDECREF(__pyx_t_6);
13913  __Pyx_XDECREF(__pyx_t_8);
13914  __Pyx_XDECREF(__pyx_t_10);
13915  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13916  __pyx_r = 0;
13917  __pyx_L0:;
13918  __Pyx_XDECREF(__pyx_v_struct);
13919  __Pyx_XDECREF(__pyx_v_bytesvalue);
13920  __Pyx_XGIVEREF(__pyx_r);
13921  __Pyx_RefNannyFinishContext();
13922  return __pyx_r;
13923 }
13924 
13925 /* "View.MemoryView":518
13926  *
13927  * @cname('getbuffer')
13928  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13929  * if flags & PyBUF_WRITABLE and self.view.readonly:
13930  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13931  */
13932 
13933 /* Python wrapper */
13934 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
13935 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13936  int __pyx_r;
13937  __Pyx_RefNannyDeclarations
13938  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
13939  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
13940 
13941  /* function exit code */
13942  __Pyx_RefNannyFinishContext();
13943  return __pyx_r;
13944 }
13945 
13946 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13947  int __pyx_r;
13948  __Pyx_RefNannyDeclarations
13949  int __pyx_t_1;
13950  int __pyx_t_2;
13951  PyObject *__pyx_t_3 = NULL;
13952  Py_ssize_t *__pyx_t_4;
13953  char *__pyx_t_5;
13954  void *__pyx_t_6;
13955  int __pyx_t_7;
13956  Py_ssize_t __pyx_t_8;
13957  if (__pyx_v_info == NULL) {
13958  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
13959  return -1;
13960  }
13961  __Pyx_RefNannySetupContext("__getbuffer__", 0);
13962  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13963  __Pyx_GIVEREF(__pyx_v_info->obj);
13964 
13965  /* "View.MemoryView":519
13966  * @cname('getbuffer')
13967  * def __getbuffer__(self, Py_buffer *info, int flags):
13968  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13969  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13970  *
13971  */
13972  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13973  if (__pyx_t_2) {
13974  } else {
13975  __pyx_t_1 = __pyx_t_2;
13976  goto __pyx_L4_bool_binop_done;
13977  }
13978  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13979  __pyx_t_1 = __pyx_t_2;
13980  __pyx_L4_bool_binop_done:;
13981  if (unlikely(__pyx_t_1)) {
13982 
13983  /* "View.MemoryView":520
13984  * def __getbuffer__(self, Py_buffer *info, int flags):
13985  * if flags & PyBUF_WRITABLE and self.view.readonly:
13986  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
13987  *
13988  * if flags & PyBUF_ND:
13989  */
13990  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
13991  __Pyx_GOTREF(__pyx_t_3);
13992  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13993  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13994  __PYX_ERR(1, 520, __pyx_L1_error)
13995 
13996  /* "View.MemoryView":519
13997  * @cname('getbuffer')
13998  * def __getbuffer__(self, Py_buffer *info, int flags):
13999  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
14000  * raise ValueError("Cannot create writable memory view from read-only memoryview")
14001  *
14002  */
14003  }
14004 
14005  /* "View.MemoryView":522
14006  * raise ValueError("Cannot create writable memory view from read-only memoryview")
14007  *
14008  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
14009  * info.shape = self.view.shape
14010  * else:
14011  */
14012  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
14013  if (__pyx_t_1) {
14014 
14015  /* "View.MemoryView":523
14016  *
14017  * if flags & PyBUF_ND:
14018  * info.shape = self.view.shape # <<<<<<<<<<<<<<
14019  * else:
14020  * info.shape = NULL
14021  */
14022  __pyx_t_4 = __pyx_v_self->view.shape;
14023  __pyx_v_info->shape = __pyx_t_4;
14024 
14025  /* "View.MemoryView":522
14026  * raise ValueError("Cannot create writable memory view from read-only memoryview")
14027  *
14028  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
14029  * info.shape = self.view.shape
14030  * else:
14031  */
14032  goto __pyx_L6;
14033  }
14034 
14035  /* "View.MemoryView":525
14036  * info.shape = self.view.shape
14037  * else:
14038  * info.shape = NULL # <<<<<<<<<<<<<<
14039  *
14040  * if flags & PyBUF_STRIDES:
14041  */
14042  /*else*/ {
14043  __pyx_v_info->shape = NULL;
14044  }
14045  __pyx_L6:;
14046 
14047  /* "View.MemoryView":527
14048  * info.shape = NULL
14049  *
14050  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
14051  * info.strides = self.view.strides
14052  * else:
14053  */
14054  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
14055  if (__pyx_t_1) {
14056 
14057  /* "View.MemoryView":528
14058  *
14059  * if flags & PyBUF_STRIDES:
14060  * info.strides = self.view.strides # <<<<<<<<<<<<<<
14061  * else:
14062  * info.strides = NULL
14063  */
14064  __pyx_t_4 = __pyx_v_self->view.strides;
14065  __pyx_v_info->strides = __pyx_t_4;
14066 
14067  /* "View.MemoryView":527
14068  * info.shape = NULL
14069  *
14070  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
14071  * info.strides = self.view.strides
14072  * else:
14073  */
14074  goto __pyx_L7;
14075  }
14076 
14077  /* "View.MemoryView":530
14078  * info.strides = self.view.strides
14079  * else:
14080  * info.strides = NULL # <<<<<<<<<<<<<<
14081  *
14082  * if flags & PyBUF_INDIRECT:
14083  */
14084  /*else*/ {
14085  __pyx_v_info->strides = NULL;
14086  }
14087  __pyx_L7:;
14088 
14089  /* "View.MemoryView":532
14090  * info.strides = NULL
14091  *
14092  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
14093  * info.suboffsets = self.view.suboffsets
14094  * else:
14095  */
14096  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
14097  if (__pyx_t_1) {
14098 
14099  /* "View.MemoryView":533
14100  *
14101  * if flags & PyBUF_INDIRECT:
14102  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
14103  * else:
14104  * info.suboffsets = NULL
14105  */
14106  __pyx_t_4 = __pyx_v_self->view.suboffsets;
14107  __pyx_v_info->suboffsets = __pyx_t_4;
14108 
14109  /* "View.MemoryView":532
14110  * info.strides = NULL
14111  *
14112  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
14113  * info.suboffsets = self.view.suboffsets
14114  * else:
14115  */
14116  goto __pyx_L8;
14117  }
14118 
14119  /* "View.MemoryView":535
14120  * info.suboffsets = self.view.suboffsets
14121  * else:
14122  * info.suboffsets = NULL # <<<<<<<<<<<<<<
14123  *
14124  * if flags & PyBUF_FORMAT:
14125  */
14126  /*else*/ {
14127  __pyx_v_info->suboffsets = NULL;
14128  }
14129  __pyx_L8:;
14130 
14131  /* "View.MemoryView":537
14132  * info.suboffsets = NULL
14133  *
14134  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
14135  * info.format = self.view.format
14136  * else:
14137  */
14138  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
14139  if (__pyx_t_1) {
14140 
14141  /* "View.MemoryView":538
14142  *
14143  * if flags & PyBUF_FORMAT:
14144  * info.format = self.view.format # <<<<<<<<<<<<<<
14145  * else:
14146  * info.format = NULL
14147  */
14148  __pyx_t_5 = __pyx_v_self->view.format;
14149  __pyx_v_info->format = __pyx_t_5;
14150 
14151  /* "View.MemoryView":537
14152  * info.suboffsets = NULL
14153  *
14154  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
14155  * info.format = self.view.format
14156  * else:
14157  */
14158  goto __pyx_L9;
14159  }
14160 
14161  /* "View.MemoryView":540
14162  * info.format = self.view.format
14163  * else:
14164  * info.format = NULL # <<<<<<<<<<<<<<
14165  *
14166  * info.buf = self.view.buf
14167  */
14168  /*else*/ {
14169  __pyx_v_info->format = NULL;
14170  }
14171  __pyx_L9:;
14172 
14173  /* "View.MemoryView":542
14174  * info.format = NULL
14175  *
14176  * info.buf = self.view.buf # <<<<<<<<<<<<<<
14177  * info.ndim = self.view.ndim
14178  * info.itemsize = self.view.itemsize
14179  */
14180  __pyx_t_6 = __pyx_v_self->view.buf;
14181  __pyx_v_info->buf = __pyx_t_6;
14182 
14183  /* "View.MemoryView":543
14184  *
14185  * info.buf = self.view.buf
14186  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
14187  * info.itemsize = self.view.itemsize
14188  * info.len = self.view.len
14189  */
14190  __pyx_t_7 = __pyx_v_self->view.ndim;
14191  __pyx_v_info->ndim = __pyx_t_7;
14192 
14193  /* "View.MemoryView":544
14194  * info.buf = self.view.buf
14195  * info.ndim = self.view.ndim
14196  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
14197  * info.len = self.view.len
14198  * info.readonly = self.view.readonly
14199  */
14200  __pyx_t_8 = __pyx_v_self->view.itemsize;
14201  __pyx_v_info->itemsize = __pyx_t_8;
14202 
14203  /* "View.MemoryView":545
14204  * info.ndim = self.view.ndim
14205  * info.itemsize = self.view.itemsize
14206  * info.len = self.view.len # <<<<<<<<<<<<<<
14207  * info.readonly = self.view.readonly
14208  * info.obj = self
14209  */
14210  __pyx_t_8 = __pyx_v_self->view.len;
14211  __pyx_v_info->len = __pyx_t_8;
14212 
14213  /* "View.MemoryView":546
14214  * info.itemsize = self.view.itemsize
14215  * info.len = self.view.len
14216  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
14217  * info.obj = self
14218  *
14219  */
14220  __pyx_t_1 = __pyx_v_self->view.readonly;
14221  __pyx_v_info->readonly = __pyx_t_1;
14222 
14223  /* "View.MemoryView":547
14224  * info.len = self.view.len
14225  * info.readonly = self.view.readonly
14226  * info.obj = self # <<<<<<<<<<<<<<
14227  *
14228  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
14229  */
14230  __Pyx_INCREF(((PyObject *)__pyx_v_self));
14231  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
14232  __Pyx_GOTREF(__pyx_v_info->obj);
14233  __Pyx_DECREF(__pyx_v_info->obj);
14234  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
14235 
14236  /* "View.MemoryView":518
14237  *
14238  * @cname('getbuffer')
14239  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
14240  * if flags & PyBUF_WRITABLE and self.view.readonly:
14241  * raise ValueError("Cannot create writable memory view from read-only memoryview")
14242  */
14243 
14244  /* function exit code */
14245  __pyx_r = 0;
14246  goto __pyx_L0;
14247  __pyx_L1_error:;
14248  __Pyx_XDECREF(__pyx_t_3);
14249  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14250  __pyx_r = -1;
14251  if (__pyx_v_info->obj != NULL) {
14252  __Pyx_GOTREF(__pyx_v_info->obj);
14253  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
14254  }
14255  goto __pyx_L2;
14256  __pyx_L0:;
14257  if (__pyx_v_info->obj == Py_None) {
14258  __Pyx_GOTREF(__pyx_v_info->obj);
14259  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
14260  }
14261  __pyx_L2:;
14262  __Pyx_RefNannyFinishContext();
14263  return __pyx_r;
14264 }
14265 
14266 /* "View.MemoryView":553
14267  *
14268  * @property
14269  * def T(self): # <<<<<<<<<<<<<<
14270  * cdef _memoryviewslice result = memoryview_copy(self)
14271  * transpose_memslice(&result.from_slice)
14272  */
14273 
14274 /* Python wrapper */
14275 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
14276 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
14277  PyObject *__pyx_r = 0;
14278  __Pyx_RefNannyDeclarations
14279  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14280  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14281 
14282  /* function exit code */
14283  __Pyx_RefNannyFinishContext();
14284  return __pyx_r;
14285 }
14286 
14287 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14288  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
14289  PyObject *__pyx_r = NULL;
14290  __Pyx_RefNannyDeclarations
14291  PyObject *__pyx_t_1 = NULL;
14292  int __pyx_t_2;
14293  __Pyx_RefNannySetupContext("__get__", 0);
14294 
14295  /* "View.MemoryView":554
14296  * @property
14297  * def T(self):
14298  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
14299  * transpose_memslice(&result.from_slice)
14300  * return result
14301  */
14302  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
14303  __Pyx_GOTREF(__pyx_t_1);
14304  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
14305  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
14306  __pyx_t_1 = 0;
14307 
14308  /* "View.MemoryView":555
14309  * def T(self):
14310  * cdef _memoryviewslice result = memoryview_copy(self)
14311  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
14312  * return result
14313  *
14314  */
14315  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
14316 
14317  /* "View.MemoryView":556
14318  * cdef _memoryviewslice result = memoryview_copy(self)
14319  * transpose_memslice(&result.from_slice)
14320  * return result # <<<<<<<<<<<<<<
14321  *
14322  * @property
14323  */
14324  __Pyx_XDECREF(__pyx_r);
14325  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14326  __pyx_r = ((PyObject *)__pyx_v_result);
14327  goto __pyx_L0;
14328 
14329  /* "View.MemoryView":553
14330  *
14331  * @property
14332  * def T(self): # <<<<<<<<<<<<<<
14333  * cdef _memoryviewslice result = memoryview_copy(self)
14334  * transpose_memslice(&result.from_slice)
14335  */
14336 
14337  /* function exit code */
14338  __pyx_L1_error:;
14339  __Pyx_XDECREF(__pyx_t_1);
14340  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14341  __pyx_r = NULL;
14342  __pyx_L0:;
14343  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14344  __Pyx_XGIVEREF(__pyx_r);
14345  __Pyx_RefNannyFinishContext();
14346  return __pyx_r;
14347 }
14348 
14349 /* "View.MemoryView":559
14350  *
14351  * @property
14352  * def base(self): # <<<<<<<<<<<<<<
14353  * return self.obj
14354  *
14355  */
14356 
14357 /* Python wrapper */
14358 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
14359 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
14360  PyObject *__pyx_r = 0;
14361  __Pyx_RefNannyDeclarations
14362  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14363  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14364 
14365  /* function exit code */
14366  __Pyx_RefNannyFinishContext();
14367  return __pyx_r;
14368 }
14369 
14370 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14371  PyObject *__pyx_r = NULL;
14372  __Pyx_RefNannyDeclarations
14373  __Pyx_RefNannySetupContext("__get__", 0);
14374 
14375  /* "View.MemoryView":560
14376  * @property
14377  * def base(self):
14378  * return self.obj # <<<<<<<<<<<<<<
14379  *
14380  * @property
14381  */
14382  __Pyx_XDECREF(__pyx_r);
14383  __Pyx_INCREF(__pyx_v_self->obj);
14384  __pyx_r = __pyx_v_self->obj;
14385  goto __pyx_L0;
14386 
14387  /* "View.MemoryView":559
14388  *
14389  * @property
14390  * def base(self): # <<<<<<<<<<<<<<
14391  * return self.obj
14392  *
14393  */
14394 
14395  /* function exit code */
14396  __pyx_L0:;
14397  __Pyx_XGIVEREF(__pyx_r);
14398  __Pyx_RefNannyFinishContext();
14399  return __pyx_r;
14400 }
14401 
14402 /* "View.MemoryView":563
14403  *
14404  * @property
14405  * def shape(self): # <<<<<<<<<<<<<<
14406  * return tuple([length for length in self.view.shape[:self.view.ndim]])
14407  *
14408  */
14409 
14410 /* Python wrapper */
14411 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
14412 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
14413  PyObject *__pyx_r = 0;
14414  __Pyx_RefNannyDeclarations
14415  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14416  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14417 
14418  /* function exit code */
14419  __Pyx_RefNannyFinishContext();
14420  return __pyx_r;
14421 }
14422 
14423 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14424  Py_ssize_t __pyx_v_length;
14425  PyObject *__pyx_r = NULL;
14426  __Pyx_RefNannyDeclarations
14427  PyObject *__pyx_t_1 = NULL;
14428  Py_ssize_t *__pyx_t_2;
14429  Py_ssize_t *__pyx_t_3;
14430  Py_ssize_t *__pyx_t_4;
14431  PyObject *__pyx_t_5 = NULL;
14432  __Pyx_RefNannySetupContext("__get__", 0);
14433 
14434  /* "View.MemoryView":564
14435  * @property
14436  * def shape(self):
14437  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
14438  *
14439  * @property
14440  */
14441  __Pyx_XDECREF(__pyx_r);
14442  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
14443  __Pyx_GOTREF(__pyx_t_1);
14444  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14445  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
14446  __pyx_t_2 = __pyx_t_4;
14447  __pyx_v_length = (__pyx_t_2[0]);
14448  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
14449  __Pyx_GOTREF(__pyx_t_5);
14450  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
14451  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14452  }
14453  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
14454  __Pyx_GOTREF(__pyx_t_5);
14455  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14456  __pyx_r = __pyx_t_5;
14457  __pyx_t_5 = 0;
14458  goto __pyx_L0;
14459 
14460  /* "View.MemoryView":563
14461  *
14462  * @property
14463  * def shape(self): # <<<<<<<<<<<<<<
14464  * return tuple([length for length in self.view.shape[:self.view.ndim]])
14465  *
14466  */
14467 
14468  /* function exit code */
14469  __pyx_L1_error:;
14470  __Pyx_XDECREF(__pyx_t_1);
14471  __Pyx_XDECREF(__pyx_t_5);
14472  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14473  __pyx_r = NULL;
14474  __pyx_L0:;
14475  __Pyx_XGIVEREF(__pyx_r);
14476  __Pyx_RefNannyFinishContext();
14477  return __pyx_r;
14478 }
14479 
14480 /* "View.MemoryView":567
14481  *
14482  * @property
14483  * def strides(self): # <<<<<<<<<<<<<<
14484  * if self.view.strides == NULL:
14485  *
14486  */
14487 
14488 /* Python wrapper */
14489 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
14490 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
14491  PyObject *__pyx_r = 0;
14492  __Pyx_RefNannyDeclarations
14493  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14494  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14495 
14496  /* function exit code */
14497  __Pyx_RefNannyFinishContext();
14498  return __pyx_r;
14499 }
14500 
14501 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14502  Py_ssize_t __pyx_v_stride;
14503  PyObject *__pyx_r = NULL;
14504  __Pyx_RefNannyDeclarations
14505  int __pyx_t_1;
14506  PyObject *__pyx_t_2 = NULL;
14507  Py_ssize_t *__pyx_t_3;
14508  Py_ssize_t *__pyx_t_4;
14509  Py_ssize_t *__pyx_t_5;
14510  PyObject *__pyx_t_6 = NULL;
14511  __Pyx_RefNannySetupContext("__get__", 0);
14512 
14513  /* "View.MemoryView":568
14514  * @property
14515  * def strides(self):
14516  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
14517  *
14518  * raise ValueError("Buffer view does not expose strides")
14519  */
14520  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
14521  if (unlikely(__pyx_t_1)) {
14522 
14523  /* "View.MemoryView":570
14524  * if self.view.strides == NULL:
14525  *
14526  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
14527  *
14528  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
14529  */
14530  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
14531  __Pyx_GOTREF(__pyx_t_2);
14532  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
14533  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14534  __PYX_ERR(1, 570, __pyx_L1_error)
14535 
14536  /* "View.MemoryView":568
14537  * @property
14538  * def strides(self):
14539  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
14540  *
14541  * raise ValueError("Buffer view does not expose strides")
14542  */
14543  }
14544 
14545  /* "View.MemoryView":572
14546  * raise ValueError("Buffer view does not expose strides")
14547  *
14548  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
14549  *
14550  * @property
14551  */
14552  __Pyx_XDECREF(__pyx_r);
14553  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
14554  __Pyx_GOTREF(__pyx_t_2);
14555  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
14556  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14557  __pyx_t_3 = __pyx_t_5;
14558  __pyx_v_stride = (__pyx_t_3[0]);
14559  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
14560  __Pyx_GOTREF(__pyx_t_6);
14561  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
14562  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14563  }
14564  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
14565  __Pyx_GOTREF(__pyx_t_6);
14566  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14567  __pyx_r = __pyx_t_6;
14568  __pyx_t_6 = 0;
14569  goto __pyx_L0;
14570 
14571  /* "View.MemoryView":567
14572  *
14573  * @property
14574  * def strides(self): # <<<<<<<<<<<<<<
14575  * if self.view.strides == NULL:
14576  *
14577  */
14578 
14579  /* function exit code */
14580  __pyx_L1_error:;
14581  __Pyx_XDECREF(__pyx_t_2);
14582  __Pyx_XDECREF(__pyx_t_6);
14583  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14584  __pyx_r = NULL;
14585  __pyx_L0:;
14586  __Pyx_XGIVEREF(__pyx_r);
14587  __Pyx_RefNannyFinishContext();
14588  return __pyx_r;
14589 }
14590 
14591 /* "View.MemoryView":575
14592  *
14593  * @property
14594  * def suboffsets(self): # <<<<<<<<<<<<<<
14595  * if self.view.suboffsets == NULL:
14596  * return (-1,) * self.view.ndim
14597  */
14598 
14599 /* Python wrapper */
14600 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
14601 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
14602  PyObject *__pyx_r = 0;
14603  __Pyx_RefNannyDeclarations
14604  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14605  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14606 
14607  /* function exit code */
14608  __Pyx_RefNannyFinishContext();
14609  return __pyx_r;
14610 }
14611 
14612 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14613  Py_ssize_t __pyx_v_suboffset;
14614  PyObject *__pyx_r = NULL;
14615  __Pyx_RefNannyDeclarations
14616  int __pyx_t_1;
14617  PyObject *__pyx_t_2 = NULL;
14618  PyObject *__pyx_t_3 = NULL;
14619  Py_ssize_t *__pyx_t_4;
14620  Py_ssize_t *__pyx_t_5;
14621  Py_ssize_t *__pyx_t_6;
14622  __Pyx_RefNannySetupContext("__get__", 0);
14623 
14624  /* "View.MemoryView":576
14625  * @property
14626  * def suboffsets(self):
14627  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
14628  * return (-1,) * self.view.ndim
14629  *
14630  */
14631  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
14632  if (__pyx_t_1) {
14633 
14634  /* "View.MemoryView":577
14635  * def suboffsets(self):
14636  * if self.view.suboffsets == NULL:
14637  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
14638  *
14639  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
14640  */
14641  __Pyx_XDECREF(__pyx_r);
14642  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
14643  __Pyx_GOTREF(__pyx_t_2);
14644  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__23, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
14645  __Pyx_GOTREF(__pyx_t_3);
14646  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14647  __pyx_r = __pyx_t_3;
14648  __pyx_t_3 = 0;
14649  goto __pyx_L0;
14650 
14651  /* "View.MemoryView":576
14652  * @property
14653  * def suboffsets(self):
14654  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
14655  * return (-1,) * self.view.ndim
14656  *
14657  */
14658  }
14659 
14660  /* "View.MemoryView":579
14661  * return (-1,) * self.view.ndim
14662  *
14663  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
14664  *
14665  * @property
14666  */
14667  __Pyx_XDECREF(__pyx_r);
14668  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
14669  __Pyx_GOTREF(__pyx_t_3);
14670  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
14671  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
14672  __pyx_t_4 = __pyx_t_6;
14673  __pyx_v_suboffset = (__pyx_t_4[0]);
14674  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
14675  __Pyx_GOTREF(__pyx_t_2);
14676  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
14677  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14678  }
14679  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
14680  __Pyx_GOTREF(__pyx_t_2);
14681  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14682  __pyx_r = __pyx_t_2;
14683  __pyx_t_2 = 0;
14684  goto __pyx_L0;
14685 
14686  /* "View.MemoryView":575
14687  *
14688  * @property
14689  * def suboffsets(self): # <<<<<<<<<<<<<<
14690  * if self.view.suboffsets == NULL:
14691  * return (-1,) * self.view.ndim
14692  */
14693 
14694  /* function exit code */
14695  __pyx_L1_error:;
14696  __Pyx_XDECREF(__pyx_t_2);
14697  __Pyx_XDECREF(__pyx_t_3);
14698  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14699  __pyx_r = NULL;
14700  __pyx_L0:;
14701  __Pyx_XGIVEREF(__pyx_r);
14702  __Pyx_RefNannyFinishContext();
14703  return __pyx_r;
14704 }
14705 
14706 /* "View.MemoryView":582
14707  *
14708  * @property
14709  * def ndim(self): # <<<<<<<<<<<<<<
14710  * return self.view.ndim
14711  *
14712  */
14713 
14714 /* Python wrapper */
14715 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
14716 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
14717  PyObject *__pyx_r = 0;
14718  __Pyx_RefNannyDeclarations
14719  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14720  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14721 
14722  /* function exit code */
14723  __Pyx_RefNannyFinishContext();
14724  return __pyx_r;
14725 }
14726 
14727 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14728  PyObject *__pyx_r = NULL;
14729  __Pyx_RefNannyDeclarations
14730  PyObject *__pyx_t_1 = NULL;
14731  __Pyx_RefNannySetupContext("__get__", 0);
14732 
14733  /* "View.MemoryView":583
14734  * @property
14735  * def ndim(self):
14736  * return self.view.ndim # <<<<<<<<<<<<<<
14737  *
14738  * @property
14739  */
14740  __Pyx_XDECREF(__pyx_r);
14741  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
14742  __Pyx_GOTREF(__pyx_t_1);
14743  __pyx_r = __pyx_t_1;
14744  __pyx_t_1 = 0;
14745  goto __pyx_L0;
14746 
14747  /* "View.MemoryView":582
14748  *
14749  * @property
14750  * def ndim(self): # <<<<<<<<<<<<<<
14751  * return self.view.ndim
14752  *
14753  */
14754 
14755  /* function exit code */
14756  __pyx_L1_error:;
14757  __Pyx_XDECREF(__pyx_t_1);
14758  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14759  __pyx_r = NULL;
14760  __pyx_L0:;
14761  __Pyx_XGIVEREF(__pyx_r);
14762  __Pyx_RefNannyFinishContext();
14763  return __pyx_r;
14764 }
14765 
14766 /* "View.MemoryView":586
14767  *
14768  * @property
14769  * def itemsize(self): # <<<<<<<<<<<<<<
14770  * return self.view.itemsize
14771  *
14772  */
14773 
14774 /* Python wrapper */
14775 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
14776 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
14777  PyObject *__pyx_r = 0;
14778  __Pyx_RefNannyDeclarations
14779  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14780  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14781 
14782  /* function exit code */
14783  __Pyx_RefNannyFinishContext();
14784  return __pyx_r;
14785 }
14786 
14787 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14788  PyObject *__pyx_r = NULL;
14789  __Pyx_RefNannyDeclarations
14790  PyObject *__pyx_t_1 = NULL;
14791  __Pyx_RefNannySetupContext("__get__", 0);
14792 
14793  /* "View.MemoryView":587
14794  * @property
14795  * def itemsize(self):
14796  * return self.view.itemsize # <<<<<<<<<<<<<<
14797  *
14798  * @property
14799  */
14800  __Pyx_XDECREF(__pyx_r);
14801  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
14802  __Pyx_GOTREF(__pyx_t_1);
14803  __pyx_r = __pyx_t_1;
14804  __pyx_t_1 = 0;
14805  goto __pyx_L0;
14806 
14807  /* "View.MemoryView":586
14808  *
14809  * @property
14810  * def itemsize(self): # <<<<<<<<<<<<<<
14811  * return self.view.itemsize
14812  *
14813  */
14814 
14815  /* function exit code */
14816  __pyx_L1_error:;
14817  __Pyx_XDECREF(__pyx_t_1);
14818  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14819  __pyx_r = NULL;
14820  __pyx_L0:;
14821  __Pyx_XGIVEREF(__pyx_r);
14822  __Pyx_RefNannyFinishContext();
14823  return __pyx_r;
14824 }
14825 
14826 /* "View.MemoryView":590
14827  *
14828  * @property
14829  * def nbytes(self): # <<<<<<<<<<<<<<
14830  * return self.size * self.view.itemsize
14831  *
14832  */
14833 
14834 /* Python wrapper */
14835 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
14836 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
14837  PyObject *__pyx_r = 0;
14838  __Pyx_RefNannyDeclarations
14839  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14840  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14841 
14842  /* function exit code */
14843  __Pyx_RefNannyFinishContext();
14844  return __pyx_r;
14845 }
14846 
14847 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14848  PyObject *__pyx_r = NULL;
14849  __Pyx_RefNannyDeclarations
14850  PyObject *__pyx_t_1 = NULL;
14851  PyObject *__pyx_t_2 = NULL;
14852  PyObject *__pyx_t_3 = NULL;
14853  __Pyx_RefNannySetupContext("__get__", 0);
14854 
14855  /* "View.MemoryView":591
14856  * @property
14857  * def nbytes(self):
14858  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
14859  *
14860  * @property
14861  */
14862  __Pyx_XDECREF(__pyx_r);
14863  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
14864  __Pyx_GOTREF(__pyx_t_1);
14865  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
14866  __Pyx_GOTREF(__pyx_t_2);
14867  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
14868  __Pyx_GOTREF(__pyx_t_3);
14869  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14870  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14871  __pyx_r = __pyx_t_3;
14872  __pyx_t_3 = 0;
14873  goto __pyx_L0;
14874 
14875  /* "View.MemoryView":590
14876  *
14877  * @property
14878  * def nbytes(self): # <<<<<<<<<<<<<<
14879  * return self.size * self.view.itemsize
14880  *
14881  */
14882 
14883  /* function exit code */
14884  __pyx_L1_error:;
14885  __Pyx_XDECREF(__pyx_t_1);
14886  __Pyx_XDECREF(__pyx_t_2);
14887  __Pyx_XDECREF(__pyx_t_3);
14888  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14889  __pyx_r = NULL;
14890  __pyx_L0:;
14891  __Pyx_XGIVEREF(__pyx_r);
14892  __Pyx_RefNannyFinishContext();
14893  return __pyx_r;
14894 }
14895 
14896 /* "View.MemoryView":594
14897  *
14898  * @property
14899  * def size(self): # <<<<<<<<<<<<<<
14900  * if self._size is None:
14901  * result = 1
14902  */
14903 
14904 /* Python wrapper */
14905 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
14906 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14907  PyObject *__pyx_r = 0;
14908  __Pyx_RefNannyDeclarations
14909  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14910  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14911 
14912  /* function exit code */
14913  __Pyx_RefNannyFinishContext();
14914  return __pyx_r;
14915 }
14916 
14917 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14918  PyObject *__pyx_v_result = NULL;
14919  PyObject *__pyx_v_length = NULL;
14920  PyObject *__pyx_r = NULL;
14921  __Pyx_RefNannyDeclarations
14922  int __pyx_t_1;
14923  int __pyx_t_2;
14924  Py_ssize_t *__pyx_t_3;
14925  Py_ssize_t *__pyx_t_4;
14926  Py_ssize_t *__pyx_t_5;
14927  PyObject *__pyx_t_6 = NULL;
14928  __Pyx_RefNannySetupContext("__get__", 0);
14929 
14930  /* "View.MemoryView":595
14931  * @property
14932  * def size(self):
14933  * if self._size is None: # <<<<<<<<<<<<<<
14934  * result = 1
14935  *
14936  */
14937  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14938  __pyx_t_2 = (__pyx_t_1 != 0);
14939  if (__pyx_t_2) {
14940 
14941  /* "View.MemoryView":596
14942  * def size(self):
14943  * if self._size is None:
14944  * result = 1 # <<<<<<<<<<<<<<
14945  *
14946  * for length in self.view.shape[:self.view.ndim]:
14947  */
14948  __Pyx_INCREF(__pyx_int_1);
14949  __pyx_v_result = __pyx_int_1;
14950 
14951  /* "View.MemoryView":598
14952  * result = 1
14953  *
14954  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
14955  * result *= length
14956  *
14957  */
14958  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14959  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14960  __pyx_t_3 = __pyx_t_5;
14961  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
14962  __Pyx_GOTREF(__pyx_t_6);
14963  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14964  __pyx_t_6 = 0;
14965 
14966  /* "View.MemoryView":599
14967  *
14968  * for length in self.view.shape[:self.view.ndim]:
14969  * result *= length # <<<<<<<<<<<<<<
14970  *
14971  * self._size = result
14972  */
14973  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
14974  __Pyx_GOTREF(__pyx_t_6);
14975  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14976  __pyx_t_6 = 0;
14977  }
14978 
14979  /* "View.MemoryView":601
14980  * result *= length
14981  *
14982  * self._size = result # <<<<<<<<<<<<<<
14983  *
14984  * return self._size
14985  */
14986  __Pyx_INCREF(__pyx_v_result);
14987  __Pyx_GIVEREF(__pyx_v_result);
14988  __Pyx_GOTREF(__pyx_v_self->_size);
14989  __Pyx_DECREF(__pyx_v_self->_size);
14990  __pyx_v_self->_size = __pyx_v_result;
14991 
14992  /* "View.MemoryView":595
14993  * @property
14994  * def size(self):
14995  * if self._size is None: # <<<<<<<<<<<<<<
14996  * result = 1
14997  *
14998  */
14999  }
15000 
15001  /* "View.MemoryView":603
15002  * self._size = result
15003  *
15004  * return self._size # <<<<<<<<<<<<<<
15005  *
15006  * def __len__(self):
15007  */
15008  __Pyx_XDECREF(__pyx_r);
15009  __Pyx_INCREF(__pyx_v_self->_size);
15010  __pyx_r = __pyx_v_self->_size;
15011  goto __pyx_L0;
15012 
15013  /* "View.MemoryView":594
15014  *
15015  * @property
15016  * def size(self): # <<<<<<<<<<<<<<
15017  * if self._size is None:
15018  * result = 1
15019  */
15020 
15021  /* function exit code */
15022  __pyx_L1_error:;
15023  __Pyx_XDECREF(__pyx_t_6);
15024  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15025  __pyx_r = NULL;
15026  __pyx_L0:;
15027  __Pyx_XDECREF(__pyx_v_result);
15028  __Pyx_XDECREF(__pyx_v_length);
15029  __Pyx_XGIVEREF(__pyx_r);
15030  __Pyx_RefNannyFinishContext();
15031  return __pyx_r;
15032 }
15033 
15034 /* "View.MemoryView":605
15035  * return self._size
15036  *
15037  * def __len__(self): # <<<<<<<<<<<<<<
15038  * if self.view.ndim >= 1:
15039  * return self.view.shape[0]
15040  */
15041 
15042 /* Python wrapper */
15043 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
15044 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
15045  Py_ssize_t __pyx_r;
15046  __Pyx_RefNannyDeclarations
15047  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
15048  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15049 
15050  /* function exit code */
15051  __Pyx_RefNannyFinishContext();
15052  return __pyx_r;
15053 }
15054 
15055 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
15056  Py_ssize_t __pyx_r;
15057  __Pyx_RefNannyDeclarations
15058  int __pyx_t_1;
15059  __Pyx_RefNannySetupContext("__len__", 0);
15060 
15061  /* "View.MemoryView":606
15062  *
15063  * def __len__(self):
15064  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
15065  * return self.view.shape[0]
15066  *
15067  */
15068  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
15069  if (__pyx_t_1) {
15070 
15071  /* "View.MemoryView":607
15072  * def __len__(self):
15073  * if self.view.ndim >= 1:
15074  * return self.view.shape[0] # <<<<<<<<<<<<<<
15075  *
15076  * return 0
15077  */
15078  __pyx_r = (__pyx_v_self->view.shape[0]);
15079  goto __pyx_L0;
15080 
15081  /* "View.MemoryView":606
15082  *
15083  * def __len__(self):
15084  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
15085  * return self.view.shape[0]
15086  *
15087  */
15088  }
15089 
15090  /* "View.MemoryView":609
15091  * return self.view.shape[0]
15092  *
15093  * return 0 # <<<<<<<<<<<<<<
15094  *
15095  * def __repr__(self):
15096  */
15097  __pyx_r = 0;
15098  goto __pyx_L0;
15099 
15100  /* "View.MemoryView":605
15101  * return self._size
15102  *
15103  * def __len__(self): # <<<<<<<<<<<<<<
15104  * if self.view.ndim >= 1:
15105  * return self.view.shape[0]
15106  */
15107 
15108  /* function exit code */
15109  __pyx_L0:;
15110  __Pyx_RefNannyFinishContext();
15111  return __pyx_r;
15112 }
15113 
15114 /* "View.MemoryView":611
15115  * return 0
15116  *
15117  * def __repr__(self): # <<<<<<<<<<<<<<
15118  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
15119  * id(self))
15120  */
15121 
15122 /* Python wrapper */
15123 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
15124 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
15125  PyObject *__pyx_r = 0;
15126  __Pyx_RefNannyDeclarations
15127  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
15128  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15129 
15130  /* function exit code */
15131  __Pyx_RefNannyFinishContext();
15132  return __pyx_r;
15133 }
15134 
15135 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
15136  PyObject *__pyx_r = NULL;
15137  __Pyx_RefNannyDeclarations
15138  PyObject *__pyx_t_1 = NULL;
15139  PyObject *__pyx_t_2 = NULL;
15140  PyObject *__pyx_t_3 = NULL;
15141  __Pyx_RefNannySetupContext("__repr__", 0);
15142 
15143  /* "View.MemoryView":612
15144  *
15145  * def __repr__(self):
15146  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
15147  * id(self))
15148  *
15149  */
15150  __Pyx_XDECREF(__pyx_r);
15151  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
15152  __Pyx_GOTREF(__pyx_t_1);
15153  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
15154  __Pyx_GOTREF(__pyx_t_2);
15155  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15156  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
15157  __Pyx_GOTREF(__pyx_t_1);
15158  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15159 
15160  /* "View.MemoryView":613
15161  * def __repr__(self):
15162  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
15163  * id(self)) # <<<<<<<<<<<<<<
15164  *
15165  * def __str__(self):
15166  */
15167  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
15168  __Pyx_GOTREF(__pyx_t_2);
15169 
15170  /* "View.MemoryView":612
15171  *
15172  * def __repr__(self):
15173  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
15174  * id(self))
15175  *
15176  */
15177  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
15178  __Pyx_GOTREF(__pyx_t_3);
15179  __Pyx_GIVEREF(__pyx_t_1);
15180  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
15181  __Pyx_GIVEREF(__pyx_t_2);
15182  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
15183  __pyx_t_1 = 0;
15184  __pyx_t_2 = 0;
15185  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
15186  __Pyx_GOTREF(__pyx_t_2);
15187  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15188  __pyx_r = __pyx_t_2;
15189  __pyx_t_2 = 0;
15190  goto __pyx_L0;
15191 
15192  /* "View.MemoryView":611
15193  * return 0
15194  *
15195  * def __repr__(self): # <<<<<<<<<<<<<<
15196  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
15197  * id(self))
15198  */
15199 
15200  /* function exit code */
15201  __pyx_L1_error:;
15202  __Pyx_XDECREF(__pyx_t_1);
15203  __Pyx_XDECREF(__pyx_t_2);
15204  __Pyx_XDECREF(__pyx_t_3);
15205  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15206  __pyx_r = NULL;
15207  __pyx_L0:;
15208  __Pyx_XGIVEREF(__pyx_r);
15209  __Pyx_RefNannyFinishContext();
15210  return __pyx_r;
15211 }
15212 
15213 /* "View.MemoryView":615
15214  * id(self))
15215  *
15216  * def __str__(self): # <<<<<<<<<<<<<<
15217  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
15218  *
15219  */
15220 
15221 /* Python wrapper */
15222 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
15223 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
15224  PyObject *__pyx_r = 0;
15225  __Pyx_RefNannyDeclarations
15226  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
15227  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15228 
15229  /* function exit code */
15230  __Pyx_RefNannyFinishContext();
15231  return __pyx_r;
15232 }
15233 
15234 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
15235  PyObject *__pyx_r = NULL;
15236  __Pyx_RefNannyDeclarations
15237  PyObject *__pyx_t_1 = NULL;
15238  PyObject *__pyx_t_2 = NULL;
15239  __Pyx_RefNannySetupContext("__str__", 0);
15240 
15241  /* "View.MemoryView":616
15242  *
15243  * def __str__(self):
15244  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
15245  *
15246  *
15247  */
15248  __Pyx_XDECREF(__pyx_r);
15249  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
15250  __Pyx_GOTREF(__pyx_t_1);
15251  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
15252  __Pyx_GOTREF(__pyx_t_2);
15253  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15254  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
15255  __Pyx_GOTREF(__pyx_t_1);
15256  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15257  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
15258  __Pyx_GOTREF(__pyx_t_2);
15259  __Pyx_GIVEREF(__pyx_t_1);
15260  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
15261  __pyx_t_1 = 0;
15262  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
15263  __Pyx_GOTREF(__pyx_t_1);
15264  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15265  __pyx_r = __pyx_t_1;
15266  __pyx_t_1 = 0;
15267  goto __pyx_L0;
15268 
15269  /* "View.MemoryView":615
15270  * id(self))
15271  *
15272  * def __str__(self): # <<<<<<<<<<<<<<
15273  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
15274  *
15275  */
15276 
15277  /* function exit code */
15278  __pyx_L1_error:;
15279  __Pyx_XDECREF(__pyx_t_1);
15280  __Pyx_XDECREF(__pyx_t_2);
15281  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15282  __pyx_r = NULL;
15283  __pyx_L0:;
15284  __Pyx_XGIVEREF(__pyx_r);
15285  __Pyx_RefNannyFinishContext();
15286  return __pyx_r;
15287 }
15288 
15289 /* "View.MemoryView":619
15290  *
15291  *
15292  * def is_c_contig(self): # <<<<<<<<<<<<<<
15293  * cdef __Pyx_memviewslice *mslice
15294  * cdef __Pyx_memviewslice tmp
15295  */
15296 
15297 /* Python wrapper */
15298 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15299 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15300  PyObject *__pyx_r = 0;
15301  __Pyx_RefNannyDeclarations
15302  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
15303  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
15304 
15305  /* function exit code */
15306  __Pyx_RefNannyFinishContext();
15307  return __pyx_r;
15308 }
15309 
15310 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
15311  __Pyx_memviewslice *__pyx_v_mslice;
15312  __Pyx_memviewslice __pyx_v_tmp;
15313  PyObject *__pyx_r = NULL;
15314  __Pyx_RefNannyDeclarations
15315  __Pyx_memviewslice *__pyx_t_1;
15316  PyObject *__pyx_t_2 = NULL;
15317  __Pyx_RefNannySetupContext("is_c_contig", 0);
15318 
15319  /* "View.MemoryView":622
15320  * cdef __Pyx_memviewslice *mslice
15321  * cdef __Pyx_memviewslice tmp
15322  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
15323  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
15324  *
15325  */
15326  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
15327  __pyx_v_mslice = __pyx_t_1;
15328 
15329  /* "View.MemoryView":623
15330  * cdef __Pyx_memviewslice tmp
15331  * mslice = get_slice_from_memview(self, &tmp)
15332  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
15333  *
15334  * def is_f_contig(self):
15335  */
15336  __Pyx_XDECREF(__pyx_r);
15337  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
15338  __Pyx_GOTREF(__pyx_t_2);
15339  __pyx_r = __pyx_t_2;
15340  __pyx_t_2 = 0;
15341  goto __pyx_L0;
15342 
15343  /* "View.MemoryView":619
15344  *
15345  *
15346  * def is_c_contig(self): # <<<<<<<<<<<<<<
15347  * cdef __Pyx_memviewslice *mslice
15348  * cdef __Pyx_memviewslice tmp
15349  */
15350 
15351  /* function exit code */
15352  __pyx_L1_error:;
15353  __Pyx_XDECREF(__pyx_t_2);
15354  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15355  __pyx_r = NULL;
15356  __pyx_L0:;
15357  __Pyx_XGIVEREF(__pyx_r);
15358  __Pyx_RefNannyFinishContext();
15359  return __pyx_r;
15360 }
15361 
15362 /* "View.MemoryView":625
15363  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
15364  *
15365  * def is_f_contig(self): # <<<<<<<<<<<<<<
15366  * cdef __Pyx_memviewslice *mslice
15367  * cdef __Pyx_memviewslice tmp
15368  */
15369 
15370 /* Python wrapper */
15371 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15372 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15373  PyObject *__pyx_r = 0;
15374  __Pyx_RefNannyDeclarations
15375  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
15376  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
15377 
15378  /* function exit code */
15379  __Pyx_RefNannyFinishContext();
15380  return __pyx_r;
15381 }
15382 
15383 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
15384  __Pyx_memviewslice *__pyx_v_mslice;
15385  __Pyx_memviewslice __pyx_v_tmp;
15386  PyObject *__pyx_r = NULL;
15387  __Pyx_RefNannyDeclarations
15388  __Pyx_memviewslice *__pyx_t_1;
15389  PyObject *__pyx_t_2 = NULL;
15390  __Pyx_RefNannySetupContext("is_f_contig", 0);
15391 
15392  /* "View.MemoryView":628
15393  * cdef __Pyx_memviewslice *mslice
15394  * cdef __Pyx_memviewslice tmp
15395  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
15396  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
15397  *
15398  */
15399  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
15400  __pyx_v_mslice = __pyx_t_1;
15401 
15402  /* "View.MemoryView":629
15403  * cdef __Pyx_memviewslice tmp
15404  * mslice = get_slice_from_memview(self, &tmp)
15405  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
15406  *
15407  * def copy(self):
15408  */
15409  __Pyx_XDECREF(__pyx_r);
15410  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
15411  __Pyx_GOTREF(__pyx_t_2);
15412  __pyx_r = __pyx_t_2;
15413  __pyx_t_2 = 0;
15414  goto __pyx_L0;
15415 
15416  /* "View.MemoryView":625
15417  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
15418  *
15419  * def is_f_contig(self): # <<<<<<<<<<<<<<
15420  * cdef __Pyx_memviewslice *mslice
15421  * cdef __Pyx_memviewslice tmp
15422  */
15423 
15424  /* function exit code */
15425  __pyx_L1_error:;
15426  __Pyx_XDECREF(__pyx_t_2);
15427  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15428  __pyx_r = NULL;
15429  __pyx_L0:;
15430  __Pyx_XGIVEREF(__pyx_r);
15431  __Pyx_RefNannyFinishContext();
15432  return __pyx_r;
15433 }
15434 
15435 /* "View.MemoryView":631
15436  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
15437  *
15438  * def copy(self): # <<<<<<<<<<<<<<
15439  * cdef __Pyx_memviewslice mslice
15440  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
15441  */
15442 
15443 /* Python wrapper */
15444 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15445 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15446  PyObject *__pyx_r = 0;
15447  __Pyx_RefNannyDeclarations
15448  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
15449  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
15450 
15451  /* function exit code */
15452  __Pyx_RefNannyFinishContext();
15453  return __pyx_r;
15454 }
15455 
15456 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
15457  __Pyx_memviewslice __pyx_v_mslice;
15458  int __pyx_v_flags;
15459  PyObject *__pyx_r = NULL;
15460  __Pyx_RefNannyDeclarations
15461  __Pyx_memviewslice __pyx_t_1;
15462  PyObject *__pyx_t_2 = NULL;
15463  __Pyx_RefNannySetupContext("copy", 0);
15464 
15465  /* "View.MemoryView":633
15466  * def copy(self):
15467  * cdef __Pyx_memviewslice mslice
15468  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
15469  *
15470  * slice_copy(self, &mslice)
15471  */
15472  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
15473 
15474  /* "View.MemoryView":635
15475  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
15476  *
15477  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
15478  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
15479  * self.view.itemsize,
15480  */
15481  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
15482 
15483  /* "View.MemoryView":636
15484  *
15485  * slice_copy(self, &mslice)
15486  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
15487  * self.view.itemsize,
15488  * flags|PyBUF_C_CONTIGUOUS,
15489  */
15490  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
15491  __pyx_v_mslice = __pyx_t_1;
15492 
15493  /* "View.MemoryView":641
15494  * self.dtype_is_object)
15495  *
15496  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
15497  *
15498  * def copy_fortran(self):
15499  */
15500  __Pyx_XDECREF(__pyx_r);
15501  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
15502  __Pyx_GOTREF(__pyx_t_2);
15503  __pyx_r = __pyx_t_2;
15504  __pyx_t_2 = 0;
15505  goto __pyx_L0;
15506 
15507  /* "View.MemoryView":631
15508  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
15509  *
15510  * def copy(self): # <<<<<<<<<<<<<<
15511  * cdef __Pyx_memviewslice mslice
15512  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
15513  */
15514 
15515  /* function exit code */
15516  __pyx_L1_error:;
15517  __Pyx_XDECREF(__pyx_t_2);
15518  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15519  __pyx_r = NULL;
15520  __pyx_L0:;
15521  __Pyx_XGIVEREF(__pyx_r);
15522  __Pyx_RefNannyFinishContext();
15523  return __pyx_r;
15524 }
15525 
15526 /* "View.MemoryView":643
15527  * return memoryview_copy_from_slice(self, &mslice)
15528  *
15529  * def copy_fortran(self): # <<<<<<<<<<<<<<
15530  * cdef __Pyx_memviewslice src, dst
15531  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15532  */
15533 
15534 /* Python wrapper */
15535 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15536 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15537  PyObject *__pyx_r = 0;
15538  __Pyx_RefNannyDeclarations
15539  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
15540  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
15541 
15542  /* function exit code */
15543  __Pyx_RefNannyFinishContext();
15544  return __pyx_r;
15545 }
15546 
15547 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
15548  __Pyx_memviewslice __pyx_v_src;
15549  __Pyx_memviewslice __pyx_v_dst;
15550  int __pyx_v_flags;
15551  PyObject *__pyx_r = NULL;
15552  __Pyx_RefNannyDeclarations
15553  __Pyx_memviewslice __pyx_t_1;
15554  PyObject *__pyx_t_2 = NULL;
15555  __Pyx_RefNannySetupContext("copy_fortran", 0);
15556 
15557  /* "View.MemoryView":645
15558  * def copy_fortran(self):
15559  * cdef __Pyx_memviewslice src, dst
15560  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
15561  *
15562  * slice_copy(self, &src)
15563  */
15564  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
15565 
15566  /* "View.MemoryView":647
15567  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15568  *
15569  * slice_copy(self, &src) # <<<<<<<<<<<<<<
15570  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
15571  * self.view.itemsize,
15572  */
15573  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
15574 
15575  /* "View.MemoryView":648
15576  *
15577  * slice_copy(self, &src)
15578  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
15579  * self.view.itemsize,
15580  * flags|PyBUF_F_CONTIGUOUS,
15581  */
15582  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
15583  __pyx_v_dst = __pyx_t_1;
15584 
15585  /* "View.MemoryView":653
15586  * self.dtype_is_object)
15587  *
15588  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
15589  *
15590  *
15591  */
15592  __Pyx_XDECREF(__pyx_r);
15593  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
15594  __Pyx_GOTREF(__pyx_t_2);
15595  __pyx_r = __pyx_t_2;
15596  __pyx_t_2 = 0;
15597  goto __pyx_L0;
15598 
15599  /* "View.MemoryView":643
15600  * return memoryview_copy_from_slice(self, &mslice)
15601  *
15602  * def copy_fortran(self): # <<<<<<<<<<<<<<
15603  * cdef __Pyx_memviewslice src, dst
15604  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15605  */
15606 
15607  /* function exit code */
15608  __pyx_L1_error:;
15609  __Pyx_XDECREF(__pyx_t_2);
15610  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
15611  __pyx_r = NULL;
15612  __pyx_L0:;
15613  __Pyx_XGIVEREF(__pyx_r);
15614  __Pyx_RefNannyFinishContext();
15615  return __pyx_r;
15616 }
15617 
15618 /* "(tree fragment)":1
15619  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15620  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15621  * def __setstate_cython__(self, __pyx_state):
15622  */
15623 
15624 /* Python wrapper */
15625 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15626 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15627  PyObject *__pyx_r = 0;
15628  __Pyx_RefNannyDeclarations
15629  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15630  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15631 
15632  /* function exit code */
15633  __Pyx_RefNannyFinishContext();
15634  return __pyx_r;
15635 }
15636 
15637 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
15638  PyObject *__pyx_r = NULL;
15639  __Pyx_RefNannyDeclarations
15640  PyObject *__pyx_t_1 = NULL;
15641  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
15642 
15643  /* "(tree fragment)":2
15644  * def __reduce_cython__(self):
15645  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15646  * def __setstate_cython__(self, __pyx_state):
15647  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15648  */
15649  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
15650  __Pyx_GOTREF(__pyx_t_1);
15651  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15652  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15653  __PYX_ERR(1, 2, __pyx_L1_error)
15654 
15655  /* "(tree fragment)":1
15656  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15657  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15658  * def __setstate_cython__(self, __pyx_state):
15659  */
15660 
15661  /* function exit code */
15662  __pyx_L1_error:;
15663  __Pyx_XDECREF(__pyx_t_1);
15664  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15665  __pyx_r = NULL;
15666  __Pyx_XGIVEREF(__pyx_r);
15667  __Pyx_RefNannyFinishContext();
15668  return __pyx_r;
15669 }
15670 
15671 /* "(tree fragment)":3
15672  * def __reduce_cython__(self):
15673  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15674  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15675  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15676  */
15677 
15678 /* Python wrapper */
15679 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
15680 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15681  PyObject *__pyx_r = 0;
15682  __Pyx_RefNannyDeclarations
15683  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15684  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15685 
15686  /* function exit code */
15687  __Pyx_RefNannyFinishContext();
15688  return __pyx_r;
15689 }
15690 
15691 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15692  PyObject *__pyx_r = NULL;
15693  __Pyx_RefNannyDeclarations
15694  PyObject *__pyx_t_1 = NULL;
15695  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15696 
15697  /* "(tree fragment)":4
15698  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15699  * def __setstate_cython__(self, __pyx_state):
15700  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15701  */
15702  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
15703  __Pyx_GOTREF(__pyx_t_1);
15704  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15705  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15706  __PYX_ERR(1, 4, __pyx_L1_error)
15707 
15708  /* "(tree fragment)":3
15709  * def __reduce_cython__(self):
15710  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15711  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15712  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15713  */
15714 
15715  /* function exit code */
15716  __pyx_L1_error:;
15717  __Pyx_XDECREF(__pyx_t_1);
15718  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15719  __pyx_r = NULL;
15720  __Pyx_XGIVEREF(__pyx_r);
15721  __Pyx_RefNannyFinishContext();
15722  return __pyx_r;
15723 }
15724 
15725 /* "View.MemoryView":657
15726  *
15727  * @cname('__pyx_memoryview_new')
15728  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
15729  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15730  * result.typeinfo = typeinfo
15731  */
15732 
15733 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
15734  struct __pyx_memoryview_obj *__pyx_v_result = 0;
15735  PyObject *__pyx_r = NULL;
15736  __Pyx_RefNannyDeclarations
15737  PyObject *__pyx_t_1 = NULL;
15738  PyObject *__pyx_t_2 = NULL;
15739  PyObject *__pyx_t_3 = NULL;
15740  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
15741 
15742  /* "View.MemoryView":658
15743  * @cname('__pyx_memoryview_new')
15744  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
15745  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
15746  * result.typeinfo = typeinfo
15747  * return result
15748  */
15749  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
15750  __Pyx_GOTREF(__pyx_t_1);
15751  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
15752  __Pyx_GOTREF(__pyx_t_2);
15753  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
15754  __Pyx_GOTREF(__pyx_t_3);
15755  __Pyx_INCREF(__pyx_v_o);
15756  __Pyx_GIVEREF(__pyx_v_o);
15757  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
15758  __Pyx_GIVEREF(__pyx_t_1);
15759  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
15760  __Pyx_GIVEREF(__pyx_t_2);
15761  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
15762  __pyx_t_1 = 0;
15763  __pyx_t_2 = 0;
15764  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
15765  __Pyx_GOTREF(__pyx_t_2);
15766  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15767  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
15768  __pyx_t_2 = 0;
15769 
15770  /* "View.MemoryView":659
15771  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
15772  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15773  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
15774  * return result
15775  *
15776  */
15777  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
15778 
15779  /* "View.MemoryView":660
15780  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15781  * result.typeinfo = typeinfo
15782  * return result # <<<<<<<<<<<<<<
15783  *
15784  * @cname('__pyx_memoryview_check')
15785  */
15786  __Pyx_XDECREF(__pyx_r);
15787  __Pyx_INCREF(((PyObject *)__pyx_v_result));
15788  __pyx_r = ((PyObject *)__pyx_v_result);
15789  goto __pyx_L0;
15790 
15791  /* "View.MemoryView":657
15792  *
15793  * @cname('__pyx_memoryview_new')
15794  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
15795  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15796  * result.typeinfo = typeinfo
15797  */
15798 
15799  /* function exit code */
15800  __pyx_L1_error:;
15801  __Pyx_XDECREF(__pyx_t_1);
15802  __Pyx_XDECREF(__pyx_t_2);
15803  __Pyx_XDECREF(__pyx_t_3);
15804  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
15805  __pyx_r = 0;
15806  __pyx_L0:;
15807  __Pyx_XDECREF((PyObject *)__pyx_v_result);
15808  __Pyx_XGIVEREF(__pyx_r);
15809  __Pyx_RefNannyFinishContext();
15810  return __pyx_r;
15811 }
15812 
15813 /* "View.MemoryView":663
15814  *
15815  * @cname('__pyx_memoryview_check')
15816  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15817  * return isinstance(o, memoryview)
15818  *
15819  */
15820 
15821 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
15822  int __pyx_r;
15823  __Pyx_RefNannyDeclarations
15824  int __pyx_t_1;
15825  __Pyx_RefNannySetupContext("memoryview_check", 0);
15826 
15827  /* "View.MemoryView":664
15828  * @cname('__pyx_memoryview_check')
15829  * cdef inline bint memoryview_check(object o):
15830  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
15831  *
15832  * cdef tuple _unellipsify(object index, int ndim):
15833  */
15834  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
15835  __pyx_r = __pyx_t_1;
15836  goto __pyx_L0;
15837 
15838  /* "View.MemoryView":663
15839  *
15840  * @cname('__pyx_memoryview_check')
15841  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15842  * return isinstance(o, memoryview)
15843  *
15844  */
15845 
15846  /* function exit code */
15847  __pyx_L0:;
15848  __Pyx_RefNannyFinishContext();
15849  return __pyx_r;
15850 }
15851 
15852 /* "View.MemoryView":666
15853  * return isinstance(o, memoryview)
15854  *
15855  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15856  * """
15857  * Replace all ellipses with full slices and fill incomplete indices with
15858  */
15859 
15860 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
15861  PyObject *__pyx_v_tup = NULL;
15862  PyObject *__pyx_v_result = NULL;
15863  int __pyx_v_have_slices;
15864  int __pyx_v_seen_ellipsis;
15865  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
15866  PyObject *__pyx_v_item = NULL;
15867  Py_ssize_t __pyx_v_nslices;
15868  PyObject *__pyx_r = NULL;
15869  __Pyx_RefNannyDeclarations
15870  int __pyx_t_1;
15871  int __pyx_t_2;
15872  PyObject *__pyx_t_3 = NULL;
15873  PyObject *__pyx_t_4 = NULL;
15874  Py_ssize_t __pyx_t_5;
15875  PyObject *(*__pyx_t_6)(PyObject *);
15876  PyObject *__pyx_t_7 = NULL;
15877  Py_ssize_t __pyx_t_8;
15878  int __pyx_t_9;
15879  int __pyx_t_10;
15880  PyObject *__pyx_t_11 = NULL;
15881  __Pyx_RefNannySetupContext("_unellipsify", 0);
15882 
15883  /* "View.MemoryView":671
15884  * full slices.
15885  * """
15886  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15887  * tup = (index,)
15888  * else:
15889  */
15890  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15891  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15892  if (__pyx_t_2) {
15893 
15894  /* "View.MemoryView":672
15895  * """
15896  * if not isinstance(index, tuple):
15897  * tup = (index,) # <<<<<<<<<<<<<<
15898  * else:
15899  * tup = index
15900  */
15901  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
15902  __Pyx_GOTREF(__pyx_t_3);
15903  __Pyx_INCREF(__pyx_v_index);
15904  __Pyx_GIVEREF(__pyx_v_index);
15905  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15906  __pyx_v_tup = __pyx_t_3;
15907  __pyx_t_3 = 0;
15908 
15909  /* "View.MemoryView":671
15910  * full slices.
15911  * """
15912  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15913  * tup = (index,)
15914  * else:
15915  */
15916  goto __pyx_L3;
15917  }
15918 
15919  /* "View.MemoryView":674
15920  * tup = (index,)
15921  * else:
15922  * tup = index # <<<<<<<<<<<<<<
15923  *
15924  * result = []
15925  */
15926  /*else*/ {
15927  __Pyx_INCREF(__pyx_v_index);
15928  __pyx_v_tup = __pyx_v_index;
15929  }
15930  __pyx_L3:;
15931 
15932  /* "View.MemoryView":676
15933  * tup = index
15934  *
15935  * result = [] # <<<<<<<<<<<<<<
15936  * have_slices = False
15937  * seen_ellipsis = False
15938  */
15939  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
15940  __Pyx_GOTREF(__pyx_t_3);
15941  __pyx_v_result = ((PyObject*)__pyx_t_3);
15942  __pyx_t_3 = 0;
15943 
15944  /* "View.MemoryView":677
15945  *
15946  * result = []
15947  * have_slices = False # <<<<<<<<<<<<<<
15948  * seen_ellipsis = False
15949  * for idx, item in enumerate(tup):
15950  */
15951  __pyx_v_have_slices = 0;
15952 
15953  /* "View.MemoryView":678
15954  * result = []
15955  * have_slices = False
15956  * seen_ellipsis = False # <<<<<<<<<<<<<<
15957  * for idx, item in enumerate(tup):
15958  * if item is Ellipsis:
15959  */
15960  __pyx_v_seen_ellipsis = 0;
15961 
15962  /* "View.MemoryView":679
15963  * have_slices = False
15964  * seen_ellipsis = False
15965  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15966  * if item is Ellipsis:
15967  * if not seen_ellipsis:
15968  */
15969  __Pyx_INCREF(__pyx_int_0);
15970  __pyx_t_3 = __pyx_int_0;
15971  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15972  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15973  __pyx_t_6 = NULL;
15974  } else {
15975  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
15976  __Pyx_GOTREF(__pyx_t_4);
15977  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
15978  }
15979  for (;;) {
15980  if (likely(!__pyx_t_6)) {
15981  if (likely(PyList_CheckExact(__pyx_t_4))) {
15982  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
15983  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15984  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
15985  #else
15986  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15987  __Pyx_GOTREF(__pyx_t_7);
15988  #endif
15989  } else {
15990  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
15991  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15992  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
15993  #else
15994  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15995  __Pyx_GOTREF(__pyx_t_7);
15996  #endif
15997  }
15998  } else {
15999  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
16000  if (unlikely(!__pyx_t_7)) {
16001  PyObject* exc_type = PyErr_Occurred();
16002  if (exc_type) {
16003  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16004  else __PYX_ERR(1, 679, __pyx_L1_error)
16005  }
16006  break;
16007  }
16008  __Pyx_GOTREF(__pyx_t_7);
16009  }
16010  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
16011  __pyx_t_7 = 0;
16012  __Pyx_INCREF(__pyx_t_3);
16013  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
16014  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
16015  __Pyx_GOTREF(__pyx_t_7);
16016  __Pyx_DECREF(__pyx_t_3);
16017  __pyx_t_3 = __pyx_t_7;
16018  __pyx_t_7 = 0;
16019 
16020  /* "View.MemoryView":680
16021  * seen_ellipsis = False
16022  * for idx, item in enumerate(tup):
16023  * if item is Ellipsis: # <<<<<<<<<<<<<<
16024  * if not seen_ellipsis:
16025  * result.extend([slice(None)] * (ndim - len(tup) + 1))
16026  */
16027  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
16028  __pyx_t_1 = (__pyx_t_2 != 0);
16029  if (__pyx_t_1) {
16030 
16031  /* "View.MemoryView":681
16032  * for idx, item in enumerate(tup):
16033  * if item is Ellipsis:
16034  * if not seen_ellipsis: # <<<<<<<<<<<<<<
16035  * result.extend([slice(None)] * (ndim - len(tup) + 1))
16036  * seen_ellipsis = True
16037  */
16038  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
16039  if (__pyx_t_1) {
16040 
16041  /* "View.MemoryView":682
16042  * if item is Ellipsis:
16043  * if not seen_ellipsis:
16044  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
16045  * seen_ellipsis = True
16046  * else:
16047  */
16048  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
16049  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
16050  __Pyx_GOTREF(__pyx_t_7);
16051  { Py_ssize_t __pyx_temp;
16052  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
16053  __Pyx_INCREF(__pyx_slice__26);
16054  __Pyx_GIVEREF(__pyx_slice__26);
16055  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__26);
16056  }
16057  }
16058  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
16059  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16060 
16061  /* "View.MemoryView":683
16062  * if not seen_ellipsis:
16063  * result.extend([slice(None)] * (ndim - len(tup) + 1))
16064  * seen_ellipsis = True # <<<<<<<<<<<<<<
16065  * else:
16066  * result.append(slice(None))
16067  */
16068  __pyx_v_seen_ellipsis = 1;
16069 
16070  /* "View.MemoryView":681
16071  * for idx, item in enumerate(tup):
16072  * if item is Ellipsis:
16073  * if not seen_ellipsis: # <<<<<<<<<<<<<<
16074  * result.extend([slice(None)] * (ndim - len(tup) + 1))
16075  * seen_ellipsis = True
16076  */
16077  goto __pyx_L7;
16078  }
16079 
16080  /* "View.MemoryView":685
16081  * seen_ellipsis = True
16082  * else:
16083  * result.append(slice(None)) # <<<<<<<<<<<<<<
16084  * have_slices = True
16085  * else:
16086  */
16087  /*else*/ {
16088  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__26); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
16089  }
16090  __pyx_L7:;
16091 
16092  /* "View.MemoryView":686
16093  * else:
16094  * result.append(slice(None))
16095  * have_slices = True # <<<<<<<<<<<<<<
16096  * else:
16097  * if not isinstance(item, slice) and not PyIndex_Check(item):
16098  */
16099  __pyx_v_have_slices = 1;
16100 
16101  /* "View.MemoryView":680
16102  * seen_ellipsis = False
16103  * for idx, item in enumerate(tup):
16104  * if item is Ellipsis: # <<<<<<<<<<<<<<
16105  * if not seen_ellipsis:
16106  * result.extend([slice(None)] * (ndim - len(tup) + 1))
16107  */
16108  goto __pyx_L6;
16109  }
16110 
16111  /* "View.MemoryView":688
16112  * have_slices = True
16113  * else:
16114  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
16115  * raise TypeError("Cannot index with type '%s'" % type(item))
16116  *
16117  */
16118  /*else*/ {
16119  __pyx_t_2 = PySlice_Check(__pyx_v_item);
16120  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
16121  if (__pyx_t_10) {
16122  } else {
16123  __pyx_t_1 = __pyx_t_10;
16124  goto __pyx_L9_bool_binop_done;
16125  }
16126  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
16127  __pyx_t_1 = __pyx_t_10;
16128  __pyx_L9_bool_binop_done:;
16129  if (unlikely(__pyx_t_1)) {
16130 
16131  /* "View.MemoryView":689
16132  * else:
16133  * if not isinstance(item, slice) and not PyIndex_Check(item):
16134  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
16135  *
16136  * have_slices = have_slices or isinstance(item, slice)
16137  */
16138  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
16139  __Pyx_GOTREF(__pyx_t_7);
16140  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
16141  __Pyx_GOTREF(__pyx_t_11);
16142  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16143  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
16144  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
16145  __PYX_ERR(1, 689, __pyx_L1_error)
16146 
16147  /* "View.MemoryView":688
16148  * have_slices = True
16149  * else:
16150  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
16151  * raise TypeError("Cannot index with type '%s'" % type(item))
16152  *
16153  */
16154  }
16155 
16156  /* "View.MemoryView":691
16157  * raise TypeError("Cannot index with type '%s'" % type(item))
16158  *
16159  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
16160  * result.append(item)
16161  *
16162  */
16163  __pyx_t_10 = (__pyx_v_have_slices != 0);
16164  if (!__pyx_t_10) {
16165  } else {
16166  __pyx_t_1 = __pyx_t_10;
16167  goto __pyx_L11_bool_binop_done;
16168  }
16169  __pyx_t_10 = PySlice_Check(__pyx_v_item);
16170  __pyx_t_2 = (__pyx_t_10 != 0);
16171  __pyx_t_1 = __pyx_t_2;
16172  __pyx_L11_bool_binop_done:;
16173  __pyx_v_have_slices = __pyx_t_1;
16174 
16175  /* "View.MemoryView":692
16176  *
16177  * have_slices = have_slices or isinstance(item, slice)
16178  * result.append(item) # <<<<<<<<<<<<<<
16179  *
16180  * nslices = ndim - len(result)
16181  */
16182  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
16183  }
16184  __pyx_L6:;
16185 
16186  /* "View.MemoryView":679
16187  * have_slices = False
16188  * seen_ellipsis = False
16189  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
16190  * if item is Ellipsis:
16191  * if not seen_ellipsis:
16192  */
16193  }
16194  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16195  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16196 
16197  /* "View.MemoryView":694
16198  * result.append(item)
16199  *
16200  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
16201  * if nslices:
16202  * result.extend([slice(None)] * nslices)
16203  */
16204  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
16205  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
16206 
16207  /* "View.MemoryView":695
16208  *
16209  * nslices = ndim - len(result)
16210  * if nslices: # <<<<<<<<<<<<<<
16211  * result.extend([slice(None)] * nslices)
16212  *
16213  */
16214  __pyx_t_1 = (__pyx_v_nslices != 0);
16215  if (__pyx_t_1) {
16216 
16217  /* "View.MemoryView":696
16218  * nslices = ndim - len(result)
16219  * if nslices:
16220  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
16221  *
16222  * return have_slices or nslices, tuple(result)
16223  */
16224  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
16225  __Pyx_GOTREF(__pyx_t_3);
16226  { Py_ssize_t __pyx_temp;
16227  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
16228  __Pyx_INCREF(__pyx_slice__26);
16229  __Pyx_GIVEREF(__pyx_slice__26);
16230  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__26);
16231  }
16232  }
16233  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
16234  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16235 
16236  /* "View.MemoryView":695
16237  *
16238  * nslices = ndim - len(result)
16239  * if nslices: # <<<<<<<<<<<<<<
16240  * result.extend([slice(None)] * nslices)
16241  *
16242  */
16243  }
16244 
16245  /* "View.MemoryView":698
16246  * result.extend([slice(None)] * nslices)
16247  *
16248  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
16249  *
16250  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
16251  */
16252  __Pyx_XDECREF(__pyx_r);
16253  if (!__pyx_v_have_slices) {
16254  } else {
16255  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
16256  __Pyx_GOTREF(__pyx_t_4);
16257  __pyx_t_3 = __pyx_t_4;
16258  __pyx_t_4 = 0;
16259  goto __pyx_L14_bool_binop_done;
16260  }
16261  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
16262  __Pyx_GOTREF(__pyx_t_4);
16263  __pyx_t_3 = __pyx_t_4;
16264  __pyx_t_4 = 0;
16265  __pyx_L14_bool_binop_done:;
16266  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
16267  __Pyx_GOTREF(__pyx_t_4);
16268  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
16269  __Pyx_GOTREF(__pyx_t_11);
16270  __Pyx_GIVEREF(__pyx_t_3);
16271  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
16272  __Pyx_GIVEREF(__pyx_t_4);
16273  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
16274  __pyx_t_3 = 0;
16275  __pyx_t_4 = 0;
16276  __pyx_r = ((PyObject*)__pyx_t_11);
16277  __pyx_t_11 = 0;
16278  goto __pyx_L0;
16279 
16280  /* "View.MemoryView":666
16281  * return isinstance(o, memoryview)
16282  *
16283  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
16284  * """
16285  * Replace all ellipses with full slices and fill incomplete indices with
16286  */
16287 
16288  /* function exit code */
16289  __pyx_L1_error:;
16290  __Pyx_XDECREF(__pyx_t_3);
16291  __Pyx_XDECREF(__pyx_t_4);
16292  __Pyx_XDECREF(__pyx_t_7);
16293  __Pyx_XDECREF(__pyx_t_11);
16294  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
16295  __pyx_r = 0;
16296  __pyx_L0:;
16297  __Pyx_XDECREF(__pyx_v_tup);
16298  __Pyx_XDECREF(__pyx_v_result);
16299  __Pyx_XDECREF(__pyx_v_idx);
16300  __Pyx_XDECREF(__pyx_v_item);
16301  __Pyx_XGIVEREF(__pyx_r);
16302  __Pyx_RefNannyFinishContext();
16303  return __pyx_r;
16304 }
16305 
16306 /* "View.MemoryView":700
16307  * return have_slices or nslices, tuple(result)
16308  *
16309  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
16310  * for suboffset in suboffsets[:ndim]:
16311  * if suboffset >= 0:
16312  */
16313 
16314 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
16315  Py_ssize_t __pyx_v_suboffset;
16316  PyObject *__pyx_r = NULL;
16317  __Pyx_RefNannyDeclarations
16318  Py_ssize_t *__pyx_t_1;
16319  Py_ssize_t *__pyx_t_2;
16320  Py_ssize_t *__pyx_t_3;
16321  int __pyx_t_4;
16322  PyObject *__pyx_t_5 = NULL;
16323  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
16324 
16325  /* "View.MemoryView":701
16326  *
16327  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
16328  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
16329  * if suboffset >= 0:
16330  * raise ValueError("Indirect dimensions not supported")
16331  */
16332  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
16333  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
16334  __pyx_t_1 = __pyx_t_3;
16335  __pyx_v_suboffset = (__pyx_t_1[0]);
16336 
16337  /* "View.MemoryView":702
16338  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
16339  * for suboffset in suboffsets[:ndim]:
16340  * if suboffset >= 0: # <<<<<<<<<<<<<<
16341  * raise ValueError("Indirect dimensions not supported")
16342  *
16343  */
16344  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
16345  if (unlikely(__pyx_t_4)) {
16346 
16347  /* "View.MemoryView":703
16348  * for suboffset in suboffsets[:ndim]:
16349  * if suboffset >= 0:
16350  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
16351  *
16352  *
16353  */
16354  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
16355  __Pyx_GOTREF(__pyx_t_5);
16356  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
16357  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16358  __PYX_ERR(1, 703, __pyx_L1_error)
16359 
16360  /* "View.MemoryView":702
16361  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
16362  * for suboffset in suboffsets[:ndim]:
16363  * if suboffset >= 0: # <<<<<<<<<<<<<<
16364  * raise ValueError("Indirect dimensions not supported")
16365  *
16366  */
16367  }
16368  }
16369 
16370  /* "View.MemoryView":700
16371  * return have_slices or nslices, tuple(result)
16372  *
16373  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
16374  * for suboffset in suboffsets[:ndim]:
16375  * if suboffset >= 0:
16376  */
16377 
16378  /* function exit code */
16379  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16380  goto __pyx_L0;
16381  __pyx_L1_error:;
16382  __Pyx_XDECREF(__pyx_t_5);
16383  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
16384  __pyx_r = 0;
16385  __pyx_L0:;
16386  __Pyx_XGIVEREF(__pyx_r);
16387  __Pyx_RefNannyFinishContext();
16388  return __pyx_r;
16389 }
16390 
16391 /* "View.MemoryView":710
16392  *
16393  * @cname('__pyx_memview_slice')
16394  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16395  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16396  * cdef bint negative_step
16397  */
16398 
16399 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
16400  int __pyx_v_new_ndim;
16401  int __pyx_v_suboffset_dim;
16402  int __pyx_v_dim;
16403  __Pyx_memviewslice __pyx_v_src;
16404  __Pyx_memviewslice __pyx_v_dst;
16405  __Pyx_memviewslice *__pyx_v_p_src;
16406  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
16407  __Pyx_memviewslice *__pyx_v_p_dst;
16408  int *__pyx_v_p_suboffset_dim;
16409  Py_ssize_t __pyx_v_start;
16410  Py_ssize_t __pyx_v_stop;
16411  Py_ssize_t __pyx_v_step;
16412  int __pyx_v_have_start;
16413  int __pyx_v_have_stop;
16414  int __pyx_v_have_step;
16415  PyObject *__pyx_v_index = NULL;
16416  struct __pyx_memoryview_obj *__pyx_r = NULL;
16417  __Pyx_RefNannyDeclarations
16418  int __pyx_t_1;
16419  int __pyx_t_2;
16420  PyObject *__pyx_t_3 = NULL;
16421  struct __pyx_memoryview_obj *__pyx_t_4;
16422  char *__pyx_t_5;
16423  int __pyx_t_6;
16424  Py_ssize_t __pyx_t_7;
16425  PyObject *(*__pyx_t_8)(PyObject *);
16426  PyObject *__pyx_t_9 = NULL;
16427  Py_ssize_t __pyx_t_10;
16428  int __pyx_t_11;
16429  Py_ssize_t __pyx_t_12;
16430  __Pyx_RefNannySetupContext("memview_slice", 0);
16431 
16432  /* "View.MemoryView":711
16433  * @cname('__pyx_memview_slice')
16434  * cdef memoryview memview_slice(memoryview memview, object indices):
16435  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
16436  * cdef bint negative_step
16437  * cdef __Pyx_memviewslice src, dst
16438  */
16439  __pyx_v_new_ndim = 0;
16440  __pyx_v_suboffset_dim = -1;
16441 
16442  /* "View.MemoryView":718
16443  *
16444  *
16445  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
16446  *
16447  * cdef _memoryviewslice memviewsliceobj
16448  */
16449  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
16450 
16451  /* "View.MemoryView":722
16452  * cdef _memoryviewslice memviewsliceobj
16453  *
16454  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
16455  *
16456  * if isinstance(memview, _memoryviewslice):
16457  */
16458  #ifndef CYTHON_WITHOUT_ASSERTIONS
16459  if (unlikely(!Py_OptimizeFlag)) {
16460  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
16461  PyErr_SetNone(PyExc_AssertionError);
16462  __PYX_ERR(1, 722, __pyx_L1_error)
16463  }
16464  }
16465  #endif
16466 
16467  /* "View.MemoryView":724
16468  * assert memview.view.ndim > 0
16469  *
16470  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16471  * memviewsliceobj = memview
16472  * p_src = &memviewsliceobj.from_slice
16473  */
16474  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16475  __pyx_t_2 = (__pyx_t_1 != 0);
16476  if (__pyx_t_2) {
16477 
16478  /* "View.MemoryView":725
16479  *
16480  * if isinstance(memview, _memoryviewslice):
16481  * memviewsliceobj = memview # <<<<<<<<<<<<<<
16482  * p_src = &memviewsliceobj.from_slice
16483  * else:
16484  */
16485  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
16486  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
16487  __Pyx_INCREF(__pyx_t_3);
16488  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
16489  __pyx_t_3 = 0;
16490 
16491  /* "View.MemoryView":726
16492  * if isinstance(memview, _memoryviewslice):
16493  * memviewsliceobj = memview
16494  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
16495  * else:
16496  * slice_copy(memview, &src)
16497  */
16498  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
16499 
16500  /* "View.MemoryView":724
16501  * assert memview.view.ndim > 0
16502  *
16503  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16504  * memviewsliceobj = memview
16505  * p_src = &memviewsliceobj.from_slice
16506  */
16507  goto __pyx_L3;
16508  }
16509 
16510  /* "View.MemoryView":728
16511  * p_src = &memviewsliceobj.from_slice
16512  * else:
16513  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
16514  * p_src = &src
16515  *
16516  */
16517  /*else*/ {
16518  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
16519 
16520  /* "View.MemoryView":729
16521  * else:
16522  * slice_copy(memview, &src)
16523  * p_src = &src # <<<<<<<<<<<<<<
16524  *
16525  *
16526  */
16527  __pyx_v_p_src = (&__pyx_v_src);
16528  }
16529  __pyx_L3:;
16530 
16531  /* "View.MemoryView":735
16532  *
16533  *
16534  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
16535  * dst.data = p_src.data
16536  *
16537  */
16538  __pyx_t_4 = __pyx_v_p_src->memview;
16539  __pyx_v_dst.memview = __pyx_t_4;
16540 
16541  /* "View.MemoryView":736
16542  *
16543  * dst.memview = p_src.memview
16544  * dst.data = p_src.data # <<<<<<<<<<<<<<
16545  *
16546  *
16547  */
16548  __pyx_t_5 = __pyx_v_p_src->data;
16549  __pyx_v_dst.data = __pyx_t_5;
16550 
16551  /* "View.MemoryView":741
16552  *
16553  *
16554  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
16555  * cdef int *p_suboffset_dim = &suboffset_dim
16556  * cdef Py_ssize_t start, stop, step
16557  */
16558  __pyx_v_p_dst = (&__pyx_v_dst);
16559 
16560  /* "View.MemoryView":742
16561  *
16562  * cdef __Pyx_memviewslice *p_dst = &dst
16563  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
16564  * cdef Py_ssize_t start, stop, step
16565  * cdef bint have_start, have_stop, have_step
16566  */
16567  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
16568 
16569  /* "View.MemoryView":746
16570  * cdef bint have_start, have_stop, have_step
16571  *
16572  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
16573  * if PyIndex_Check(index):
16574  * slice_memviewslice(
16575  */
16576  __pyx_t_6 = 0;
16577  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
16578  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
16579  __pyx_t_8 = NULL;
16580  } else {
16581  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
16582  __Pyx_GOTREF(__pyx_t_3);
16583  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
16584  }
16585  for (;;) {
16586  if (likely(!__pyx_t_8)) {
16587  if (likely(PyList_CheckExact(__pyx_t_3))) {
16588  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
16589  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16590  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
16591  #else
16592  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
16593  __Pyx_GOTREF(__pyx_t_9);
16594  #endif
16595  } else {
16596  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
16597  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16598  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
16599  #else
16600  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
16601  __Pyx_GOTREF(__pyx_t_9);
16602  #endif
16603  }
16604  } else {
16605  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
16606  if (unlikely(!__pyx_t_9)) {
16607  PyObject* exc_type = PyErr_Occurred();
16608  if (exc_type) {
16609  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16610  else __PYX_ERR(1, 746, __pyx_L1_error)
16611  }
16612  break;
16613  }
16614  __Pyx_GOTREF(__pyx_t_9);
16615  }
16616  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
16617  __pyx_t_9 = 0;
16618  __pyx_v_dim = __pyx_t_6;
16619  __pyx_t_6 = (__pyx_t_6 + 1);
16620 
16621  /* "View.MemoryView":747
16622  *
16623  * for dim, index in enumerate(indices):
16624  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
16625  * slice_memviewslice(
16626  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16627  */
16628  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
16629  if (__pyx_t_2) {
16630 
16631  /* "View.MemoryView":751
16632  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16633  * dim, new_ndim, p_suboffset_dim,
16634  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
16635  * 0, 0, 0, # have_{start,stop,step}
16636  * False)
16637  */
16638  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
16639 
16640  /* "View.MemoryView":748
16641  * for dim, index in enumerate(indices):
16642  * if PyIndex_Check(index):
16643  * slice_memviewslice( # <<<<<<<<<<<<<<
16644  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16645  * dim, new_ndim, p_suboffset_dim,
16646  */
16647  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
16648 
16649  /* "View.MemoryView":747
16650  *
16651  * for dim, index in enumerate(indices):
16652  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
16653  * slice_memviewslice(
16654  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16655  */
16656  goto __pyx_L6;
16657  }
16658 
16659  /* "View.MemoryView":754
16660  * 0, 0, 0, # have_{start,stop,step}
16661  * False)
16662  * elif index is None: # <<<<<<<<<<<<<<
16663  * p_dst.shape[new_ndim] = 1
16664  * p_dst.strides[new_ndim] = 0
16665  */
16666  __pyx_t_2 = (__pyx_v_index == Py_None);
16667  __pyx_t_1 = (__pyx_t_2 != 0);
16668  if (__pyx_t_1) {
16669 
16670  /* "View.MemoryView":755
16671  * False)
16672  * elif index is None:
16673  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
16674  * p_dst.strides[new_ndim] = 0
16675  * p_dst.suboffsets[new_ndim] = -1
16676  */
16677  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
16678 
16679  /* "View.MemoryView":756
16680  * elif index is None:
16681  * p_dst.shape[new_ndim] = 1
16682  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
16683  * p_dst.suboffsets[new_ndim] = -1
16684  * new_ndim += 1
16685  */
16686  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
16687 
16688  /* "View.MemoryView":757
16689  * p_dst.shape[new_ndim] = 1
16690  * p_dst.strides[new_ndim] = 0
16691  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
16692  * new_ndim += 1
16693  * else:
16694  */
16695  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
16696 
16697  /* "View.MemoryView":758
16698  * p_dst.strides[new_ndim] = 0
16699  * p_dst.suboffsets[new_ndim] = -1
16700  * new_ndim += 1 # <<<<<<<<<<<<<<
16701  * else:
16702  * start = index.start or 0
16703  */
16704  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16705 
16706  /* "View.MemoryView":754
16707  * 0, 0, 0, # have_{start,stop,step}
16708  * False)
16709  * elif index is None: # <<<<<<<<<<<<<<
16710  * p_dst.shape[new_ndim] = 1
16711  * p_dst.strides[new_ndim] = 0
16712  */
16713  goto __pyx_L6;
16714  }
16715 
16716  /* "View.MemoryView":760
16717  * new_ndim += 1
16718  * else:
16719  * start = index.start or 0 # <<<<<<<<<<<<<<
16720  * stop = index.stop or 0
16721  * step = index.step or 0
16722  */
16723  /*else*/ {
16724  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
16725  __Pyx_GOTREF(__pyx_t_9);
16726  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
16727  if (!__pyx_t_1) {
16728  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16729  } else {
16730  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
16731  __pyx_t_10 = __pyx_t_12;
16732  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16733  goto __pyx_L7_bool_binop_done;
16734  }
16735  __pyx_t_10 = 0;
16736  __pyx_L7_bool_binop_done:;
16737  __pyx_v_start = __pyx_t_10;
16738 
16739  /* "View.MemoryView":761
16740  * else:
16741  * start = index.start or 0
16742  * stop = index.stop or 0 # <<<<<<<<<<<<<<
16743  * step = index.step or 0
16744  *
16745  */
16746  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
16747  __Pyx_GOTREF(__pyx_t_9);
16748  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
16749  if (!__pyx_t_1) {
16750  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16751  } else {
16752  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
16753  __pyx_t_10 = __pyx_t_12;
16754  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16755  goto __pyx_L9_bool_binop_done;
16756  }
16757  __pyx_t_10 = 0;
16758  __pyx_L9_bool_binop_done:;
16759  __pyx_v_stop = __pyx_t_10;
16760 
16761  /* "View.MemoryView":762
16762  * start = index.start or 0
16763  * stop = index.stop or 0
16764  * step = index.step or 0 # <<<<<<<<<<<<<<
16765  *
16766  * have_start = index.start is not None
16767  */
16768  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
16769  __Pyx_GOTREF(__pyx_t_9);
16770  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
16771  if (!__pyx_t_1) {
16772  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16773  } else {
16774  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
16775  __pyx_t_10 = __pyx_t_12;
16776  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16777  goto __pyx_L11_bool_binop_done;
16778  }
16779  __pyx_t_10 = 0;
16780  __pyx_L11_bool_binop_done:;
16781  __pyx_v_step = __pyx_t_10;
16782 
16783  /* "View.MemoryView":764
16784  * step = index.step or 0
16785  *
16786  * have_start = index.start is not None # <<<<<<<<<<<<<<
16787  * have_stop = index.stop is not None
16788  * have_step = index.step is not None
16789  */
16790  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
16791  __Pyx_GOTREF(__pyx_t_9);
16792  __pyx_t_1 = (__pyx_t_9 != Py_None);
16793  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16794  __pyx_v_have_start = __pyx_t_1;
16795 
16796  /* "View.MemoryView":765
16797  *
16798  * have_start = index.start is not None
16799  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
16800  * have_step = index.step is not None
16801  *
16802  */
16803  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
16804  __Pyx_GOTREF(__pyx_t_9);
16805  __pyx_t_1 = (__pyx_t_9 != Py_None);
16806  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16807  __pyx_v_have_stop = __pyx_t_1;
16808 
16809  /* "View.MemoryView":766
16810  * have_start = index.start is not None
16811  * have_stop = index.stop is not None
16812  * have_step = index.step is not None # <<<<<<<<<<<<<<
16813  *
16814  * slice_memviewslice(
16815  */
16816  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
16817  __Pyx_GOTREF(__pyx_t_9);
16818  __pyx_t_1 = (__pyx_t_9 != Py_None);
16819  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16820  __pyx_v_have_step = __pyx_t_1;
16821 
16822  /* "View.MemoryView":768
16823  * have_step = index.step is not None
16824  *
16825  * slice_memviewslice( # <<<<<<<<<<<<<<
16826  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16827  * dim, new_ndim, p_suboffset_dim,
16828  */
16829  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
16830 
16831  /* "View.MemoryView":774
16832  * have_start, have_stop, have_step,
16833  * True)
16834  * new_ndim += 1 # <<<<<<<<<<<<<<
16835  *
16836  * if isinstance(memview, _memoryviewslice):
16837  */
16838  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16839  }
16840  __pyx_L6:;
16841 
16842  /* "View.MemoryView":746
16843  * cdef bint have_start, have_stop, have_step
16844  *
16845  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
16846  * if PyIndex_Check(index):
16847  * slice_memviewslice(
16848  */
16849  }
16850  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16851 
16852  /* "View.MemoryView":776
16853  * new_ndim += 1
16854  *
16855  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16856  * return memoryview_fromslice(dst, new_ndim,
16857  * memviewsliceobj.to_object_func,
16858  */
16859  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16860  __pyx_t_2 = (__pyx_t_1 != 0);
16861  if (__pyx_t_2) {
16862 
16863  /* "View.MemoryView":777
16864  *
16865  * if isinstance(memview, _memoryviewslice):
16866  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16867  * memviewsliceobj.to_object_func,
16868  * memviewsliceobj.to_dtype_func,
16869  */
16870  __Pyx_XDECREF(((PyObject *)__pyx_r));
16871 
16872  /* "View.MemoryView":778
16873  * if isinstance(memview, _memoryviewslice):
16874  * return memoryview_fromslice(dst, new_ndim,
16875  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
16876  * memviewsliceobj.to_dtype_func,
16877  * memview.dtype_is_object)
16878  */
16879  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
16880 
16881  /* "View.MemoryView":779
16882  * return memoryview_fromslice(dst, new_ndim,
16883  * memviewsliceobj.to_object_func,
16884  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
16885  * memview.dtype_is_object)
16886  * else:
16887  */
16888  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
16889 
16890  /* "View.MemoryView":777
16891  *
16892  * if isinstance(memview, _memoryviewslice):
16893  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16894  * memviewsliceobj.to_object_func,
16895  * memviewsliceobj.to_dtype_func,
16896  */
16897  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
16898  __Pyx_GOTREF(__pyx_t_3);
16899  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
16900  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16901  __pyx_t_3 = 0;
16902  goto __pyx_L0;
16903 
16904  /* "View.MemoryView":776
16905  * new_ndim += 1
16906  *
16907  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16908  * return memoryview_fromslice(dst, new_ndim,
16909  * memviewsliceobj.to_object_func,
16910  */
16911  }
16912 
16913  /* "View.MemoryView":782
16914  * memview.dtype_is_object)
16915  * else:
16916  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16917  * memview.dtype_is_object)
16918  *
16919  */
16920  /*else*/ {
16921  __Pyx_XDECREF(((PyObject *)__pyx_r));
16922 
16923  /* "View.MemoryView":783
16924  * else:
16925  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
16926  * memview.dtype_is_object) # <<<<<<<<<<<<<<
16927  *
16928  *
16929  */
16930  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
16931  __Pyx_GOTREF(__pyx_t_3);
16932 
16933  /* "View.MemoryView":782
16934  * memview.dtype_is_object)
16935  * else:
16936  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16937  * memview.dtype_is_object)
16938  *
16939  */
16940  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
16941  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16942  __pyx_t_3 = 0;
16943  goto __pyx_L0;
16944  }
16945 
16946  /* "View.MemoryView":710
16947  *
16948  * @cname('__pyx_memview_slice')
16949  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16950  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16951  * cdef bint negative_step
16952  */
16953 
16954  /* function exit code */
16955  __pyx_L1_error:;
16956  __Pyx_XDECREF(__pyx_t_3);
16957  __Pyx_XDECREF(__pyx_t_9);
16958  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16959  __pyx_r = 0;
16960  __pyx_L0:;
16961  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16962  __Pyx_XDECREF(__pyx_v_index);
16963  __Pyx_XGIVEREF((PyObject *)__pyx_r);
16964  __Pyx_RefNannyFinishContext();
16965  return __pyx_r;
16966 }
16967 
16968 /* "View.MemoryView":807
16969  *
16970  * @cname('__pyx_memoryview_slice_memviewslice')
16971  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16972  * __Pyx_memviewslice *dst,
16973  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16974  */
16975 
16976 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
16977  Py_ssize_t __pyx_v_new_shape;
16978  int __pyx_v_negative_step;
16979  int __pyx_r;
16980  int __pyx_t_1;
16981  int __pyx_t_2;
16982  int __pyx_t_3;
16983 
16984  /* "View.MemoryView":827
16985  * cdef bint negative_step
16986  *
16987  * if not is_slice: # <<<<<<<<<<<<<<
16988  *
16989  * if start < 0:
16990  */
16991  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16992  if (__pyx_t_1) {
16993 
16994  /* "View.MemoryView":829
16995  * if not is_slice:
16996  *
16997  * if start < 0: # <<<<<<<<<<<<<<
16998  * start += shape
16999  * if not 0 <= start < shape:
17000  */
17001  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
17002  if (__pyx_t_1) {
17003 
17004  /* "View.MemoryView":830
17005  *
17006  * if start < 0:
17007  * start += shape # <<<<<<<<<<<<<<
17008  * if not 0 <= start < shape:
17009  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
17010  */
17011  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
17012 
17013  /* "View.MemoryView":829
17014  * if not is_slice:
17015  *
17016  * if start < 0: # <<<<<<<<<<<<<<
17017  * start += shape
17018  * if not 0 <= start < shape:
17019  */
17020  }
17021 
17022  /* "View.MemoryView":831
17023  * if start < 0:
17024  * start += shape
17025  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
17026  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
17027  * else:
17028  */
17029  __pyx_t_1 = (0 <= __pyx_v_start);
17030  if (__pyx_t_1) {
17031  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
17032  }
17033  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
17034  if (__pyx_t_2) {
17035 
17036  /* "View.MemoryView":832
17037  * start += shape
17038  * if not 0 <= start < shape:
17039  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
17040  * else:
17041  *
17042  */
17043  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
17044 
17045  /* "View.MemoryView":831
17046  * if start < 0:
17047  * start += shape
17048  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
17049  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
17050  * else:
17051  */
17052  }
17053 
17054  /* "View.MemoryView":827
17055  * cdef bint negative_step
17056  *
17057  * if not is_slice: # <<<<<<<<<<<<<<
17058  *
17059  * if start < 0:
17060  */
17061  goto __pyx_L3;
17062  }
17063 
17064  /* "View.MemoryView":835
17065  * else:
17066  *
17067  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
17068  *
17069  * if have_step and step == 0:
17070  */
17071  /*else*/ {
17072  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
17073  if (__pyx_t_1) {
17074  } else {
17075  __pyx_t_2 = __pyx_t_1;
17076  goto __pyx_L6_bool_binop_done;
17077  }
17078  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
17079  __pyx_t_2 = __pyx_t_1;
17080  __pyx_L6_bool_binop_done:;
17081  __pyx_v_negative_step = __pyx_t_2;
17082 
17083  /* "View.MemoryView":837
17084  * negative_step = have_step != 0 and step < 0
17085  *
17086  * if have_step and step == 0: # <<<<<<<<<<<<<<
17087  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
17088  *
17089  */
17090  __pyx_t_1 = (__pyx_v_have_step != 0);
17091  if (__pyx_t_1) {
17092  } else {
17093  __pyx_t_2 = __pyx_t_1;
17094  goto __pyx_L9_bool_binop_done;
17095  }
17096  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
17097  __pyx_t_2 = __pyx_t_1;
17098  __pyx_L9_bool_binop_done:;
17099  if (__pyx_t_2) {
17100 
17101  /* "View.MemoryView":838
17102  *
17103  * if have_step and step == 0:
17104  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
17105  *
17106  *
17107  */
17108  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
17109 
17110  /* "View.MemoryView":837
17111  * negative_step = have_step != 0 and step < 0
17112  *
17113  * if have_step and step == 0: # <<<<<<<<<<<<<<
17114  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
17115  *
17116  */
17117  }
17118 
17119  /* "View.MemoryView":841
17120  *
17121  *
17122  * if have_start: # <<<<<<<<<<<<<<
17123  * if start < 0:
17124  * start += shape
17125  */
17126  __pyx_t_2 = (__pyx_v_have_start != 0);
17127  if (__pyx_t_2) {
17128 
17129  /* "View.MemoryView":842
17130  *
17131  * if have_start:
17132  * if start < 0: # <<<<<<<<<<<<<<
17133  * start += shape
17134  * if start < 0:
17135  */
17136  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
17137  if (__pyx_t_2) {
17138 
17139  /* "View.MemoryView":843
17140  * if have_start:
17141  * if start < 0:
17142  * start += shape # <<<<<<<<<<<<<<
17143  * if start < 0:
17144  * start = 0
17145  */
17146  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
17147 
17148  /* "View.MemoryView":844
17149  * if start < 0:
17150  * start += shape
17151  * if start < 0: # <<<<<<<<<<<<<<
17152  * start = 0
17153  * elif start >= shape:
17154  */
17155  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
17156  if (__pyx_t_2) {
17157 
17158  /* "View.MemoryView":845
17159  * start += shape
17160  * if start < 0:
17161  * start = 0 # <<<<<<<<<<<<<<
17162  * elif start >= shape:
17163  * if negative_step:
17164  */
17165  __pyx_v_start = 0;
17166 
17167  /* "View.MemoryView":844
17168  * if start < 0:
17169  * start += shape
17170  * if start < 0: # <<<<<<<<<<<<<<
17171  * start = 0
17172  * elif start >= shape:
17173  */
17174  }
17175 
17176  /* "View.MemoryView":842
17177  *
17178  * if have_start:
17179  * if start < 0: # <<<<<<<<<<<<<<
17180  * start += shape
17181  * if start < 0:
17182  */
17183  goto __pyx_L12;
17184  }
17185 
17186  /* "View.MemoryView":846
17187  * if start < 0:
17188  * start = 0
17189  * elif start >= shape: # <<<<<<<<<<<<<<
17190  * if negative_step:
17191  * start = shape - 1
17192  */
17193  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
17194  if (__pyx_t_2) {
17195 
17196  /* "View.MemoryView":847
17197  * start = 0
17198  * elif start >= shape:
17199  * if negative_step: # <<<<<<<<<<<<<<
17200  * start = shape - 1
17201  * else:
17202  */
17203  __pyx_t_2 = (__pyx_v_negative_step != 0);
17204  if (__pyx_t_2) {
17205 
17206  /* "View.MemoryView":848
17207  * elif start >= shape:
17208  * if negative_step:
17209  * start = shape - 1 # <<<<<<<<<<<<<<
17210  * else:
17211  * start = shape
17212  */
17213  __pyx_v_start = (__pyx_v_shape - 1);
17214 
17215  /* "View.MemoryView":847
17216  * start = 0
17217  * elif start >= shape:
17218  * if negative_step: # <<<<<<<<<<<<<<
17219  * start = shape - 1
17220  * else:
17221  */
17222  goto __pyx_L14;
17223  }
17224 
17225  /* "View.MemoryView":850
17226  * start = shape - 1
17227  * else:
17228  * start = shape # <<<<<<<<<<<<<<
17229  * else:
17230  * if negative_step:
17231  */
17232  /*else*/ {
17233  __pyx_v_start = __pyx_v_shape;
17234  }
17235  __pyx_L14:;
17236 
17237  /* "View.MemoryView":846
17238  * if start < 0:
17239  * start = 0
17240  * elif start >= shape: # <<<<<<<<<<<<<<
17241  * if negative_step:
17242  * start = shape - 1
17243  */
17244  }
17245  __pyx_L12:;
17246 
17247  /* "View.MemoryView":841
17248  *
17249  *
17250  * if have_start: # <<<<<<<<<<<<<<
17251  * if start < 0:
17252  * start += shape
17253  */
17254  goto __pyx_L11;
17255  }
17256 
17257  /* "View.MemoryView":852
17258  * start = shape
17259  * else:
17260  * if negative_step: # <<<<<<<<<<<<<<
17261  * start = shape - 1
17262  * else:
17263  */
17264  /*else*/ {
17265  __pyx_t_2 = (__pyx_v_negative_step != 0);
17266  if (__pyx_t_2) {
17267 
17268  /* "View.MemoryView":853
17269  * else:
17270  * if negative_step:
17271  * start = shape - 1 # <<<<<<<<<<<<<<
17272  * else:
17273  * start = 0
17274  */
17275  __pyx_v_start = (__pyx_v_shape - 1);
17276 
17277  /* "View.MemoryView":852
17278  * start = shape
17279  * else:
17280  * if negative_step: # <<<<<<<<<<<<<<
17281  * start = shape - 1
17282  * else:
17283  */
17284  goto __pyx_L15;
17285  }
17286 
17287  /* "View.MemoryView":855
17288  * start = shape - 1
17289  * else:
17290  * start = 0 # <<<<<<<<<<<<<<
17291  *
17292  * if have_stop:
17293  */
17294  /*else*/ {
17295  __pyx_v_start = 0;
17296  }
17297  __pyx_L15:;
17298  }
17299  __pyx_L11:;
17300 
17301  /* "View.MemoryView":857
17302  * start = 0
17303  *
17304  * if have_stop: # <<<<<<<<<<<<<<
17305  * if stop < 0:
17306  * stop += shape
17307  */
17308  __pyx_t_2 = (__pyx_v_have_stop != 0);
17309  if (__pyx_t_2) {
17310 
17311  /* "View.MemoryView":858
17312  *
17313  * if have_stop:
17314  * if stop < 0: # <<<<<<<<<<<<<<
17315  * stop += shape
17316  * if stop < 0:
17317  */
17318  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
17319  if (__pyx_t_2) {
17320 
17321  /* "View.MemoryView":859
17322  * if have_stop:
17323  * if stop < 0:
17324  * stop += shape # <<<<<<<<<<<<<<
17325  * if stop < 0:
17326  * stop = 0
17327  */
17328  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
17329 
17330  /* "View.MemoryView":860
17331  * if stop < 0:
17332  * stop += shape
17333  * if stop < 0: # <<<<<<<<<<<<<<
17334  * stop = 0
17335  * elif stop > shape:
17336  */
17337  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
17338  if (__pyx_t_2) {
17339 
17340  /* "View.MemoryView":861
17341  * stop += shape
17342  * if stop < 0:
17343  * stop = 0 # <<<<<<<<<<<<<<
17344  * elif stop > shape:
17345  * stop = shape
17346  */
17347  __pyx_v_stop = 0;
17348 
17349  /* "View.MemoryView":860
17350  * if stop < 0:
17351  * stop += shape
17352  * if stop < 0: # <<<<<<<<<<<<<<
17353  * stop = 0
17354  * elif stop > shape:
17355  */
17356  }
17357 
17358  /* "View.MemoryView":858
17359  *
17360  * if have_stop:
17361  * if stop < 0: # <<<<<<<<<<<<<<
17362  * stop += shape
17363  * if stop < 0:
17364  */
17365  goto __pyx_L17;
17366  }
17367 
17368  /* "View.MemoryView":862
17369  * if stop < 0:
17370  * stop = 0
17371  * elif stop > shape: # <<<<<<<<<<<<<<
17372  * stop = shape
17373  * else:
17374  */
17375  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
17376  if (__pyx_t_2) {
17377 
17378  /* "View.MemoryView":863
17379  * stop = 0
17380  * elif stop > shape:
17381  * stop = shape # <<<<<<<<<<<<<<
17382  * else:
17383  * if negative_step:
17384  */
17385  __pyx_v_stop = __pyx_v_shape;
17386 
17387  /* "View.MemoryView":862
17388  * if stop < 0:
17389  * stop = 0
17390  * elif stop > shape: # <<<<<<<<<<<<<<
17391  * stop = shape
17392  * else:
17393  */
17394  }
17395  __pyx_L17:;
17396 
17397  /* "View.MemoryView":857
17398  * start = 0
17399  *
17400  * if have_stop: # <<<<<<<<<<<<<<
17401  * if stop < 0:
17402  * stop += shape
17403  */
17404  goto __pyx_L16;
17405  }
17406 
17407  /* "View.MemoryView":865
17408  * stop = shape
17409  * else:
17410  * if negative_step: # <<<<<<<<<<<<<<
17411  * stop = -1
17412  * else:
17413  */
17414  /*else*/ {
17415  __pyx_t_2 = (__pyx_v_negative_step != 0);
17416  if (__pyx_t_2) {
17417 
17418  /* "View.MemoryView":866
17419  * else:
17420  * if negative_step:
17421  * stop = -1 # <<<<<<<<<<<<<<
17422  * else:
17423  * stop = shape
17424  */
17425  __pyx_v_stop = -1L;
17426 
17427  /* "View.MemoryView":865
17428  * stop = shape
17429  * else:
17430  * if negative_step: # <<<<<<<<<<<<<<
17431  * stop = -1
17432  * else:
17433  */
17434  goto __pyx_L19;
17435  }
17436 
17437  /* "View.MemoryView":868
17438  * stop = -1
17439  * else:
17440  * stop = shape # <<<<<<<<<<<<<<
17441  *
17442  * if not have_step:
17443  */
17444  /*else*/ {
17445  __pyx_v_stop = __pyx_v_shape;
17446  }
17447  __pyx_L19:;
17448  }
17449  __pyx_L16:;
17450 
17451  /* "View.MemoryView":870
17452  * stop = shape
17453  *
17454  * if not have_step: # <<<<<<<<<<<<<<
17455  * step = 1
17456  *
17457  */
17458  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
17459  if (__pyx_t_2) {
17460 
17461  /* "View.MemoryView":871
17462  *
17463  * if not have_step:
17464  * step = 1 # <<<<<<<<<<<<<<
17465  *
17466  *
17467  */
17468  __pyx_v_step = 1;
17469 
17470  /* "View.MemoryView":870
17471  * stop = shape
17472  *
17473  * if not have_step: # <<<<<<<<<<<<<<
17474  * step = 1
17475  *
17476  */
17477  }
17478 
17479  /* "View.MemoryView":875
17480  *
17481  * with cython.cdivision(True):
17482  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
17483  *
17484  * if (stop - start) - step * new_shape:
17485  */
17486  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
17487 
17488  /* "View.MemoryView":877
17489  * new_shape = (stop - start) // step
17490  *
17491  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
17492  * new_shape += 1
17493  *
17494  */
17495  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
17496  if (__pyx_t_2) {
17497 
17498  /* "View.MemoryView":878
17499  *
17500  * if (stop - start) - step * new_shape:
17501  * new_shape += 1 # <<<<<<<<<<<<<<
17502  *
17503  * if new_shape < 0:
17504  */
17505  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
17506 
17507  /* "View.MemoryView":877
17508  * new_shape = (stop - start) // step
17509  *
17510  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
17511  * new_shape += 1
17512  *
17513  */
17514  }
17515 
17516  /* "View.MemoryView":880
17517  * new_shape += 1
17518  *
17519  * if new_shape < 0: # <<<<<<<<<<<<<<
17520  * new_shape = 0
17521  *
17522  */
17523  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
17524  if (__pyx_t_2) {
17525 
17526  /* "View.MemoryView":881
17527  *
17528  * if new_shape < 0:
17529  * new_shape = 0 # <<<<<<<<<<<<<<
17530  *
17531  *
17532  */
17533  __pyx_v_new_shape = 0;
17534 
17535  /* "View.MemoryView":880
17536  * new_shape += 1
17537  *
17538  * if new_shape < 0: # <<<<<<<<<<<<<<
17539  * new_shape = 0
17540  *
17541  */
17542  }
17543 
17544  /* "View.MemoryView":884
17545  *
17546  *
17547  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
17548  * dst.shape[new_ndim] = new_shape
17549  * dst.suboffsets[new_ndim] = suboffset
17550  */
17551  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
17552 
17553  /* "View.MemoryView":885
17554  *
17555  * dst.strides[new_ndim] = stride * step
17556  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
17557  * dst.suboffsets[new_ndim] = suboffset
17558  *
17559  */
17560  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
17561 
17562  /* "View.MemoryView":886
17563  * dst.strides[new_ndim] = stride * step
17564  * dst.shape[new_ndim] = new_shape
17565  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
17566  *
17567  *
17568  */
17569  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
17570  }
17571  __pyx_L3:;
17572 
17573  /* "View.MemoryView":889
17574  *
17575  *
17576  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
17577  * dst.data += start * stride
17578  * else:
17579  */
17580  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
17581  if (__pyx_t_2) {
17582 
17583  /* "View.MemoryView":890
17584  *
17585  * if suboffset_dim[0] < 0:
17586  * dst.data += start * stride # <<<<<<<<<<<<<<
17587  * else:
17588  * dst.suboffsets[suboffset_dim[0]] += start * stride
17589  */
17590  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
17591 
17592  /* "View.MemoryView":889
17593  *
17594  *
17595  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
17596  * dst.data += start * stride
17597  * else:
17598  */
17599  goto __pyx_L23;
17600  }
17601 
17602  /* "View.MemoryView":892
17603  * dst.data += start * stride
17604  * else:
17605  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
17606  *
17607  * if suboffset >= 0:
17608  */
17609  /*else*/ {
17610  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
17611  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
17612  }
17613  __pyx_L23:;
17614 
17615  /* "View.MemoryView":894
17616  * dst.suboffsets[suboffset_dim[0]] += start * stride
17617  *
17618  * if suboffset >= 0: # <<<<<<<<<<<<<<
17619  * if not is_slice:
17620  * if new_ndim == 0:
17621  */
17622  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17623  if (__pyx_t_2) {
17624 
17625  /* "View.MemoryView":895
17626  *
17627  * if suboffset >= 0:
17628  * if not is_slice: # <<<<<<<<<<<<<<
17629  * if new_ndim == 0:
17630  * dst.data = (<char **> dst.data)[0] + suboffset
17631  */
17632  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
17633  if (__pyx_t_2) {
17634 
17635  /* "View.MemoryView":896
17636  * if suboffset >= 0:
17637  * if not is_slice:
17638  * if new_ndim == 0: # <<<<<<<<<<<<<<
17639  * dst.data = (<char **> dst.data)[0] + suboffset
17640  * else:
17641  */
17642  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
17643  if (__pyx_t_2) {
17644 
17645  /* "View.MemoryView":897
17646  * if not is_slice:
17647  * if new_ndim == 0:
17648  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
17649  * else:
17650  * _err_dim(IndexError, "All dimensions preceding dimension %d "
17651  */
17652  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
17653 
17654  /* "View.MemoryView":896
17655  * if suboffset >= 0:
17656  * if not is_slice:
17657  * if new_ndim == 0: # <<<<<<<<<<<<<<
17658  * dst.data = (<char **> dst.data)[0] + suboffset
17659  * else:
17660  */
17661  goto __pyx_L26;
17662  }
17663 
17664  /* "View.MemoryView":899
17665  * dst.data = (<char **> dst.data)[0] + suboffset
17666  * else:
17667  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
17668  * "must be indexed and not sliced", dim)
17669  * else:
17670  */
17671  /*else*/ {
17672 
17673  /* "View.MemoryView":900
17674  * else:
17675  * _err_dim(IndexError, "All dimensions preceding dimension %d "
17676  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
17677  * else:
17678  * suboffset_dim[0] = new_ndim
17679  */
17680  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
17681  }
17682  __pyx_L26:;
17683 
17684  /* "View.MemoryView":895
17685  *
17686  * if suboffset >= 0:
17687  * if not is_slice: # <<<<<<<<<<<<<<
17688  * if new_ndim == 0:
17689  * dst.data = (<char **> dst.data)[0] + suboffset
17690  */
17691  goto __pyx_L25;
17692  }
17693 
17694  /* "View.MemoryView":902
17695  * "must be indexed and not sliced", dim)
17696  * else:
17697  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
17698  *
17699  * return 0
17700  */
17701  /*else*/ {
17702  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
17703  }
17704  __pyx_L25:;
17705 
17706  /* "View.MemoryView":894
17707  * dst.suboffsets[suboffset_dim[0]] += start * stride
17708  *
17709  * if suboffset >= 0: # <<<<<<<<<<<<<<
17710  * if not is_slice:
17711  * if new_ndim == 0:
17712  */
17713  }
17714 
17715  /* "View.MemoryView":904
17716  * suboffset_dim[0] = new_ndim
17717  *
17718  * return 0 # <<<<<<<<<<<<<<
17719  *
17720  *
17721  */
17722  __pyx_r = 0;
17723  goto __pyx_L0;
17724 
17725  /* "View.MemoryView":807
17726  *
17727  * @cname('__pyx_memoryview_slice_memviewslice')
17728  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
17729  * __Pyx_memviewslice *dst,
17730  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
17731  */
17732 
17733  /* function exit code */
17734  __pyx_L1_error:;
17735  {
17736  #ifdef WITH_THREAD
17737  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17738  #endif
17739  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17740  #ifdef WITH_THREAD
17741  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17742  #endif
17743  }
17744  __pyx_r = -1;
17745  __pyx_L0:;
17746  return __pyx_r;
17747 }
17748 
17749 /* "View.MemoryView":910
17750  *
17751  * @cname('__pyx_pybuffer_index')
17752  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17753  * Py_ssize_t dim) except NULL:
17754  * cdef Py_ssize_t shape, stride, suboffset = -1
17755  */
17756 
17757 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
17758  Py_ssize_t __pyx_v_shape;
17759  Py_ssize_t __pyx_v_stride;
17760  Py_ssize_t __pyx_v_suboffset;
17761  Py_ssize_t __pyx_v_itemsize;
17762  char *__pyx_v_resultp;
17763  char *__pyx_r;
17764  __Pyx_RefNannyDeclarations
17765  Py_ssize_t __pyx_t_1;
17766  int __pyx_t_2;
17767  PyObject *__pyx_t_3 = NULL;
17768  PyObject *__pyx_t_4 = NULL;
17769  __Pyx_RefNannySetupContext("pybuffer_index", 0);
17770 
17771  /* "View.MemoryView":912
17772  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
17773  * Py_ssize_t dim) except NULL:
17774  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
17775  * cdef Py_ssize_t itemsize = view.itemsize
17776  * cdef char *resultp
17777  */
17778  __pyx_v_suboffset = -1L;
17779 
17780  /* "View.MemoryView":913
17781  * Py_ssize_t dim) except NULL:
17782  * cdef Py_ssize_t shape, stride, suboffset = -1
17783  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
17784  * cdef char *resultp
17785  *
17786  */
17787  __pyx_t_1 = __pyx_v_view->itemsize;
17788  __pyx_v_itemsize = __pyx_t_1;
17789 
17790  /* "View.MemoryView":916
17791  * cdef char *resultp
17792  *
17793  * if view.ndim == 0: # <<<<<<<<<<<<<<
17794  * shape = view.len / itemsize
17795  * stride = itemsize
17796  */
17797  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
17798  if (__pyx_t_2) {
17799 
17800  /* "View.MemoryView":917
17801  *
17802  * if view.ndim == 0:
17803  * shape = view.len / itemsize # <<<<<<<<<<<<<<
17804  * stride = itemsize
17805  * else:
17806  */
17807  if (unlikely(__pyx_v_itemsize == 0)) {
17808  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
17809  __PYX_ERR(1, 917, __pyx_L1_error)
17810  }
17811  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
17812  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
17813  __PYX_ERR(1, 917, __pyx_L1_error)
17814  }
17815  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
17816 
17817  /* "View.MemoryView":918
17818  * if view.ndim == 0:
17819  * shape = view.len / itemsize
17820  * stride = itemsize # <<<<<<<<<<<<<<
17821  * else:
17822  * shape = view.shape[dim]
17823  */
17824  __pyx_v_stride = __pyx_v_itemsize;
17825 
17826  /* "View.MemoryView":916
17827  * cdef char *resultp
17828  *
17829  * if view.ndim == 0: # <<<<<<<<<<<<<<
17830  * shape = view.len / itemsize
17831  * stride = itemsize
17832  */
17833  goto __pyx_L3;
17834  }
17835 
17836  /* "View.MemoryView":920
17837  * stride = itemsize
17838  * else:
17839  * shape = view.shape[dim] # <<<<<<<<<<<<<<
17840  * stride = view.strides[dim]
17841  * if view.suboffsets != NULL:
17842  */
17843  /*else*/ {
17844  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
17845 
17846  /* "View.MemoryView":921
17847  * else:
17848  * shape = view.shape[dim]
17849  * stride = view.strides[dim] # <<<<<<<<<<<<<<
17850  * if view.suboffsets != NULL:
17851  * suboffset = view.suboffsets[dim]
17852  */
17853  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
17854 
17855  /* "View.MemoryView":922
17856  * shape = view.shape[dim]
17857  * stride = view.strides[dim]
17858  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17859  * suboffset = view.suboffsets[dim]
17860  *
17861  */
17862  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
17863  if (__pyx_t_2) {
17864 
17865  /* "View.MemoryView":923
17866  * stride = view.strides[dim]
17867  * if view.suboffsets != NULL:
17868  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
17869  *
17870  * if index < 0:
17871  */
17872  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
17873 
17874  /* "View.MemoryView":922
17875  * shape = view.shape[dim]
17876  * stride = view.strides[dim]
17877  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17878  * suboffset = view.suboffsets[dim]
17879  *
17880  */
17881  }
17882  }
17883  __pyx_L3:;
17884 
17885  /* "View.MemoryView":925
17886  * suboffset = view.suboffsets[dim]
17887  *
17888  * if index < 0: # <<<<<<<<<<<<<<
17889  * index += view.shape[dim]
17890  * if index < 0:
17891  */
17892  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17893  if (__pyx_t_2) {
17894 
17895  /* "View.MemoryView":926
17896  *
17897  * if index < 0:
17898  * index += view.shape[dim] # <<<<<<<<<<<<<<
17899  * if index < 0:
17900  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17901  */
17902  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17903 
17904  /* "View.MemoryView":927
17905  * if index < 0:
17906  * index += view.shape[dim]
17907  * if index < 0: # <<<<<<<<<<<<<<
17908  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17909  *
17910  */
17911  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17912  if (unlikely(__pyx_t_2)) {
17913 
17914  /* "View.MemoryView":928
17915  * index += view.shape[dim]
17916  * if index < 0:
17917  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17918  *
17919  * if index >= shape:
17920  */
17921  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
17922  __Pyx_GOTREF(__pyx_t_3);
17923  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
17924  __Pyx_GOTREF(__pyx_t_4);
17925  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17926  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
17927  __Pyx_GOTREF(__pyx_t_3);
17928  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17929  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17930  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17931  __PYX_ERR(1, 928, __pyx_L1_error)
17932 
17933  /* "View.MemoryView":927
17934  * if index < 0:
17935  * index += view.shape[dim]
17936  * if index < 0: # <<<<<<<<<<<<<<
17937  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17938  *
17939  */
17940  }
17941 
17942  /* "View.MemoryView":925
17943  * suboffset = view.suboffsets[dim]
17944  *
17945  * if index < 0: # <<<<<<<<<<<<<<
17946  * index += view.shape[dim]
17947  * if index < 0:
17948  */
17949  }
17950 
17951  /* "View.MemoryView":930
17952  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17953  *
17954  * if index >= shape: # <<<<<<<<<<<<<<
17955  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17956  *
17957  */
17958  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17959  if (unlikely(__pyx_t_2)) {
17960 
17961  /* "View.MemoryView":931
17962  *
17963  * if index >= shape:
17964  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17965  *
17966  * resultp = bufp + index * stride
17967  */
17968  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
17969  __Pyx_GOTREF(__pyx_t_3);
17970  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
17971  __Pyx_GOTREF(__pyx_t_4);
17972  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17973  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
17974  __Pyx_GOTREF(__pyx_t_3);
17975  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17976  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17977  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17978  __PYX_ERR(1, 931, __pyx_L1_error)
17979 
17980  /* "View.MemoryView":930
17981  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17982  *
17983  * if index >= shape: # <<<<<<<<<<<<<<
17984  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17985  *
17986  */
17987  }
17988 
17989  /* "View.MemoryView":933
17990  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17991  *
17992  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
17993  * if suboffset >= 0:
17994  * resultp = (<char **> resultp)[0] + suboffset
17995  */
17996  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17997 
17998  /* "View.MemoryView":934
17999  *
18000  * resultp = bufp + index * stride
18001  * if suboffset >= 0: # <<<<<<<<<<<<<<
18002  * resultp = (<char **> resultp)[0] + suboffset
18003  *
18004  */
18005  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
18006  if (__pyx_t_2) {
18007 
18008  /* "View.MemoryView":935
18009  * resultp = bufp + index * stride
18010  * if suboffset >= 0:
18011  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
18012  *
18013  * return resultp
18014  */
18015  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
18016 
18017  /* "View.MemoryView":934
18018  *
18019  * resultp = bufp + index * stride
18020  * if suboffset >= 0: # <<<<<<<<<<<<<<
18021  * resultp = (<char **> resultp)[0] + suboffset
18022  *
18023  */
18024  }
18025 
18026  /* "View.MemoryView":937
18027  * resultp = (<char **> resultp)[0] + suboffset
18028  *
18029  * return resultp # <<<<<<<<<<<<<<
18030  *
18031  *
18032  */
18033  __pyx_r = __pyx_v_resultp;
18034  goto __pyx_L0;
18035 
18036  /* "View.MemoryView":910
18037  *
18038  * @cname('__pyx_pybuffer_index')
18039  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
18040  * Py_ssize_t dim) except NULL:
18041  * cdef Py_ssize_t shape, stride, suboffset = -1
18042  */
18043 
18044  /* function exit code */
18045  __pyx_L1_error:;
18046  __Pyx_XDECREF(__pyx_t_3);
18047  __Pyx_XDECREF(__pyx_t_4);
18048  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
18049  __pyx_r = NULL;
18050  __pyx_L0:;
18051  __Pyx_RefNannyFinishContext();
18052  return __pyx_r;
18053 }
18054 
18055 /* "View.MemoryView":943
18056  *
18057  * @cname('__pyx_memslice_transpose')
18058  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
18059  * cdef int ndim = memslice.memview.view.ndim
18060  *
18061  */
18062 
18063 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
18064  int __pyx_v_ndim;
18065  Py_ssize_t *__pyx_v_shape;
18066  Py_ssize_t *__pyx_v_strides;
18067  int __pyx_v_i;
18068  int __pyx_v_j;
18069  int __pyx_r;
18070  int __pyx_t_1;
18071  Py_ssize_t *__pyx_t_2;
18072  long __pyx_t_3;
18073  long __pyx_t_4;
18074  Py_ssize_t __pyx_t_5;
18075  Py_ssize_t __pyx_t_6;
18076  int __pyx_t_7;
18077  int __pyx_t_8;
18078  int __pyx_t_9;
18079 
18080  /* "View.MemoryView":944
18081  * @cname('__pyx_memslice_transpose')
18082  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
18083  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
18084  *
18085  * cdef Py_ssize_t *shape = memslice.shape
18086  */
18087  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
18088  __pyx_v_ndim = __pyx_t_1;
18089 
18090  /* "View.MemoryView":946
18091  * cdef int ndim = memslice.memview.view.ndim
18092  *
18093  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
18094  * cdef Py_ssize_t *strides = memslice.strides
18095  *
18096  */
18097  __pyx_t_2 = __pyx_v_memslice->shape;
18098  __pyx_v_shape = __pyx_t_2;
18099 
18100  /* "View.MemoryView":947
18101  *
18102  * cdef Py_ssize_t *shape = memslice.shape
18103  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
18104  *
18105  *
18106  */
18107  __pyx_t_2 = __pyx_v_memslice->strides;
18108  __pyx_v_strides = __pyx_t_2;
18109 
18110  /* "View.MemoryView":951
18111  *
18112  * cdef int i, j
18113  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
18114  * j = ndim - 1 - i
18115  * strides[i], strides[j] = strides[j], strides[i]
18116  */
18117  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
18118  __pyx_t_4 = __pyx_t_3;
18119  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
18120  __pyx_v_i = __pyx_t_1;
18121 
18122  /* "View.MemoryView":952
18123  * cdef int i, j
18124  * for i in range(ndim / 2):
18125  * j = ndim - 1 - i # <<<<<<<<<<<<<<
18126  * strides[i], strides[j] = strides[j], strides[i]
18127  * shape[i], shape[j] = shape[j], shape[i]
18128  */
18129  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
18130 
18131  /* "View.MemoryView":953
18132  * for i in range(ndim / 2):
18133  * j = ndim - 1 - i
18134  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
18135  * shape[i], shape[j] = shape[j], shape[i]
18136  *
18137  */
18138  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
18139  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
18140  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
18141  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
18142 
18143  /* "View.MemoryView":954
18144  * j = ndim - 1 - i
18145  * strides[i], strides[j] = strides[j], strides[i]
18146  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
18147  *
18148  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
18149  */
18150  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
18151  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
18152  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
18153  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
18154 
18155  /* "View.MemoryView":956
18156  * shape[i], shape[j] = shape[j], shape[i]
18157  *
18158  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
18159  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
18160  *
18161  */
18162  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
18163  if (!__pyx_t_8) {
18164  } else {
18165  __pyx_t_7 = __pyx_t_8;
18166  goto __pyx_L6_bool_binop_done;
18167  }
18168  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
18169  __pyx_t_7 = __pyx_t_8;
18170  __pyx_L6_bool_binop_done:;
18171  if (__pyx_t_7) {
18172 
18173  /* "View.MemoryView":957
18174  *
18175  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
18176  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
18177  *
18178  * return 1
18179  */
18180  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
18181 
18182  /* "View.MemoryView":956
18183  * shape[i], shape[j] = shape[j], shape[i]
18184  *
18185  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
18186  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
18187  *
18188  */
18189  }
18190  }
18191 
18192  /* "View.MemoryView":959
18193  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
18194  *
18195  * return 1 # <<<<<<<<<<<<<<
18196  *
18197  *
18198  */
18199  __pyx_r = 1;
18200  goto __pyx_L0;
18201 
18202  /* "View.MemoryView":943
18203  *
18204  * @cname('__pyx_memslice_transpose')
18205  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
18206  * cdef int ndim = memslice.memview.view.ndim
18207  *
18208  */
18209 
18210  /* function exit code */
18211  __pyx_L1_error:;
18212  {
18213  #ifdef WITH_THREAD
18214  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18215  #endif
18216  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18217  #ifdef WITH_THREAD
18218  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18219  #endif
18220  }
18221  __pyx_r = 0;
18222  __pyx_L0:;
18223  return __pyx_r;
18224 }
18225 
18226 /* "View.MemoryView":976
18227  * cdef int (*to_dtype_func)(char *, object) except 0
18228  *
18229  * def __dealloc__(self): # <<<<<<<<<<<<<<
18230  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
18231  *
18232  */
18233 
18234 /* Python wrapper */
18235 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
18236 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
18237  __Pyx_RefNannyDeclarations
18238  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
18239  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18240 
18241  /* function exit code */
18242  __Pyx_RefNannyFinishContext();
18243 }
18244 
18245 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18246  __Pyx_RefNannyDeclarations
18247  __Pyx_RefNannySetupContext("__dealloc__", 0);
18248 
18249  /* "View.MemoryView":977
18250  *
18251  * def __dealloc__(self):
18252  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
18253  *
18254  * cdef convert_item_to_object(self, char *itemp):
18255  */
18256  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
18257 
18258  /* "View.MemoryView":976
18259  * cdef int (*to_dtype_func)(char *, object) except 0
18260  *
18261  * def __dealloc__(self): # <<<<<<<<<<<<<<
18262  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
18263  *
18264  */
18265 
18266  /* function exit code */
18267  __Pyx_RefNannyFinishContext();
18268 }
18269 
18270 /* "View.MemoryView":979
18271  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
18272  *
18273  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
18274  * if self.to_object_func != NULL:
18275  * return self.to_object_func(itemp)
18276  */
18277 
18278 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
18279  PyObject *__pyx_r = NULL;
18280  __Pyx_RefNannyDeclarations
18281  int __pyx_t_1;
18282  PyObject *__pyx_t_2 = NULL;
18283  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
18284 
18285  /* "View.MemoryView":980
18286  *
18287  * cdef convert_item_to_object(self, char *itemp):
18288  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
18289  * return self.to_object_func(itemp)
18290  * else:
18291  */
18292  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
18293  if (__pyx_t_1) {
18294 
18295  /* "View.MemoryView":981
18296  * cdef convert_item_to_object(self, char *itemp):
18297  * if self.to_object_func != NULL:
18298  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
18299  * else:
18300  * return memoryview.convert_item_to_object(self, itemp)
18301  */
18302  __Pyx_XDECREF(__pyx_r);
18303  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
18304  __Pyx_GOTREF(__pyx_t_2);
18305  __pyx_r = __pyx_t_2;
18306  __pyx_t_2 = 0;
18307  goto __pyx_L0;
18308 
18309  /* "View.MemoryView":980
18310  *
18311  * cdef convert_item_to_object(self, char *itemp):
18312  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
18313  * return self.to_object_func(itemp)
18314  * else:
18315  */
18316  }
18317 
18318  /* "View.MemoryView":983
18319  * return self.to_object_func(itemp)
18320  * else:
18321  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
18322  *
18323  * cdef assign_item_from_object(self, char *itemp, object value):
18324  */
18325  /*else*/ {
18326  __Pyx_XDECREF(__pyx_r);
18327  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
18328  __Pyx_GOTREF(__pyx_t_2);
18329  __pyx_r = __pyx_t_2;
18330  __pyx_t_2 = 0;
18331  goto __pyx_L0;
18332  }
18333 
18334  /* "View.MemoryView":979
18335  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
18336  *
18337  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
18338  * if self.to_object_func != NULL:
18339  * return self.to_object_func(itemp)
18340  */
18341 
18342  /* function exit code */
18343  __pyx_L1_error:;
18344  __Pyx_XDECREF(__pyx_t_2);
18345  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18346  __pyx_r = 0;
18347  __pyx_L0:;
18348  __Pyx_XGIVEREF(__pyx_r);
18349  __Pyx_RefNannyFinishContext();
18350  return __pyx_r;
18351 }
18352 
18353 /* "View.MemoryView":985
18354  * return memoryview.convert_item_to_object(self, itemp)
18355  *
18356  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
18357  * if self.to_dtype_func != NULL:
18358  * self.to_dtype_func(itemp, value)
18359  */
18360 
18361 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
18362  PyObject *__pyx_r = NULL;
18363  __Pyx_RefNannyDeclarations
18364  int __pyx_t_1;
18365  int __pyx_t_2;
18366  PyObject *__pyx_t_3 = NULL;
18367  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
18368 
18369  /* "View.MemoryView":986
18370  *
18371  * cdef assign_item_from_object(self, char *itemp, object value):
18372  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
18373  * self.to_dtype_func(itemp, value)
18374  * else:
18375  */
18376  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
18377  if (__pyx_t_1) {
18378 
18379  /* "View.MemoryView":987
18380  * cdef assign_item_from_object(self, char *itemp, object value):
18381  * if self.to_dtype_func != NULL:
18382  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
18383  * else:
18384  * memoryview.assign_item_from_object(self, itemp, value)
18385  */
18386  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
18387 
18388  /* "View.MemoryView":986
18389  *
18390  * cdef assign_item_from_object(self, char *itemp, object value):
18391  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
18392  * self.to_dtype_func(itemp, value)
18393  * else:
18394  */
18395  goto __pyx_L3;
18396  }
18397 
18398  /* "View.MemoryView":989
18399  * self.to_dtype_func(itemp, value)
18400  * else:
18401  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
18402  *
18403  * @property
18404  */
18405  /*else*/ {
18406  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
18407  __Pyx_GOTREF(__pyx_t_3);
18408  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18409  }
18410  __pyx_L3:;
18411 
18412  /* "View.MemoryView":985
18413  * return memoryview.convert_item_to_object(self, itemp)
18414  *
18415  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
18416  * if self.to_dtype_func != NULL:
18417  * self.to_dtype_func(itemp, value)
18418  */
18419 
18420  /* function exit code */
18421  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18422  goto __pyx_L0;
18423  __pyx_L1_error:;
18424  __Pyx_XDECREF(__pyx_t_3);
18425  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18426  __pyx_r = 0;
18427  __pyx_L0:;
18428  __Pyx_XGIVEREF(__pyx_r);
18429  __Pyx_RefNannyFinishContext();
18430  return __pyx_r;
18431 }
18432 
18433 /* "View.MemoryView":992
18434  *
18435  * @property
18436  * def base(self): # <<<<<<<<<<<<<<
18437  * return self.from_object
18438  *
18439  */
18440 
18441 /* Python wrapper */
18442 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
18443 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
18444  PyObject *__pyx_r = 0;
18445  __Pyx_RefNannyDeclarations
18446  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18447  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18448 
18449  /* function exit code */
18450  __Pyx_RefNannyFinishContext();
18451  return __pyx_r;
18452 }
18453 
18454 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18455  PyObject *__pyx_r = NULL;
18456  __Pyx_RefNannyDeclarations
18457  __Pyx_RefNannySetupContext("__get__", 0);
18458 
18459  /* "View.MemoryView":993
18460  * @property
18461  * def base(self):
18462  * return self.from_object # <<<<<<<<<<<<<<
18463  *
18464  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
18465  */
18466  __Pyx_XDECREF(__pyx_r);
18467  __Pyx_INCREF(__pyx_v_self->from_object);
18468  __pyx_r = __pyx_v_self->from_object;
18469  goto __pyx_L0;
18470 
18471  /* "View.MemoryView":992
18472  *
18473  * @property
18474  * def base(self): # <<<<<<<<<<<<<<
18475  * return self.from_object
18476  *
18477  */
18478 
18479  /* function exit code */
18480  __pyx_L0:;
18481  __Pyx_XGIVEREF(__pyx_r);
18482  __Pyx_RefNannyFinishContext();
18483  return __pyx_r;
18484 }
18485 
18486 /* "(tree fragment)":1
18487  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
18488  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18489  * def __setstate_cython__(self, __pyx_state):
18490  */
18491 
18492 /* Python wrapper */
18493 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
18494 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18495  PyObject *__pyx_r = 0;
18496  __Pyx_RefNannyDeclarations
18497  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
18498  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18499 
18500  /* function exit code */
18501  __Pyx_RefNannyFinishContext();
18502  return __pyx_r;
18503 }
18504 
18505 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18506  PyObject *__pyx_r = NULL;
18507  __Pyx_RefNannyDeclarations
18508  PyObject *__pyx_t_1 = NULL;
18509  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
18510 
18511  /* "(tree fragment)":2
18512  * def __reduce_cython__(self):
18513  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
18514  * def __setstate_cython__(self, __pyx_state):
18515  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18516  */
18517  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
18518  __Pyx_GOTREF(__pyx_t_1);
18519  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18520  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18521  __PYX_ERR(1, 2, __pyx_L1_error)
18522 
18523  /* "(tree fragment)":1
18524  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
18525  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18526  * def __setstate_cython__(self, __pyx_state):
18527  */
18528 
18529  /* function exit code */
18530  __pyx_L1_error:;
18531  __Pyx_XDECREF(__pyx_t_1);
18532  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18533  __pyx_r = NULL;
18534  __Pyx_XGIVEREF(__pyx_r);
18535  __Pyx_RefNannyFinishContext();
18536  return __pyx_r;
18537 }
18538 
18539 /* "(tree fragment)":3
18540  * def __reduce_cython__(self):
18541  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18542  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18543  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18544  */
18545 
18546 /* Python wrapper */
18547 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
18548 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18549  PyObject *__pyx_r = 0;
18550  __Pyx_RefNannyDeclarations
18551  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
18552  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18553 
18554  /* function exit code */
18555  __Pyx_RefNannyFinishContext();
18556  return __pyx_r;
18557 }
18558 
18559 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18560  PyObject *__pyx_r = NULL;
18561  __Pyx_RefNannyDeclarations
18562  PyObject *__pyx_t_1 = NULL;
18563  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
18564 
18565  /* "(tree fragment)":4
18566  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18567  * def __setstate_cython__(self, __pyx_state):
18568  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
18569  */
18570  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18571  __Pyx_GOTREF(__pyx_t_1);
18572  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18573  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18574  __PYX_ERR(1, 4, __pyx_L1_error)
18575 
18576  /* "(tree fragment)":3
18577  * def __reduce_cython__(self):
18578  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18579  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18580  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18581  */
18582 
18583  /* function exit code */
18584  __pyx_L1_error:;
18585  __Pyx_XDECREF(__pyx_t_1);
18586  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18587  __pyx_r = NULL;
18588  __Pyx_XGIVEREF(__pyx_r);
18589  __Pyx_RefNannyFinishContext();
18590  return __pyx_r;
18591 }
18592 
18593 /* "View.MemoryView":999
18594  *
18595  * @cname('__pyx_memoryview_fromslice')
18596  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18597  * int ndim,
18598  * object (*to_object_func)(char *),
18599  */
18600 
18601 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
18602  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
18603  Py_ssize_t __pyx_v_suboffset;
18604  PyObject *__pyx_v_length = NULL;
18605  PyObject *__pyx_r = NULL;
18606  __Pyx_RefNannyDeclarations
18607  int __pyx_t_1;
18608  PyObject *__pyx_t_2 = NULL;
18609  PyObject *__pyx_t_3 = NULL;
18610  __Pyx_TypeInfo *__pyx_t_4;
18611  Py_buffer __pyx_t_5;
18612  Py_ssize_t *__pyx_t_6;
18613  Py_ssize_t *__pyx_t_7;
18614  Py_ssize_t *__pyx_t_8;
18615  Py_ssize_t __pyx_t_9;
18616  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
18617 
18618  /* "View.MemoryView":1007
18619  * cdef _memoryviewslice result
18620  *
18621  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
18622  * return None
18623  *
18624  */
18625  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
18626  if (__pyx_t_1) {
18627 
18628  /* "View.MemoryView":1008
18629  *
18630  * if <PyObject *> memviewslice.memview == Py_None:
18631  * return None # <<<<<<<<<<<<<<
18632  *
18633  *
18634  */
18635  __Pyx_XDECREF(__pyx_r);
18636  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18637  goto __pyx_L0;
18638 
18639  /* "View.MemoryView":1007
18640  * cdef _memoryviewslice result
18641  *
18642  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
18643  * return None
18644  *
18645  */
18646  }
18647 
18648  /* "View.MemoryView":1013
18649  *
18650  *
18651  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
18652  *
18653  * result.from_slice = memviewslice
18654  */
18655  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
18656  __Pyx_GOTREF(__pyx_t_2);
18657  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
18658  __Pyx_GOTREF(__pyx_t_3);
18659  __Pyx_INCREF(Py_None);
18660  __Pyx_GIVEREF(Py_None);
18661  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
18662  __Pyx_INCREF(__pyx_int_0);
18663  __Pyx_GIVEREF(__pyx_int_0);
18664  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
18665  __Pyx_GIVEREF(__pyx_t_2);
18666  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18667  __pyx_t_2 = 0;
18668  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
18669  __Pyx_GOTREF(__pyx_t_2);
18670  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18671  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
18672  __pyx_t_2 = 0;
18673 
18674  /* "View.MemoryView":1015
18675  * result = _memoryviewslice(None, 0, dtype_is_object)
18676  *
18677  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
18678  * __PYX_INC_MEMVIEW(&memviewslice, 1)
18679  *
18680  */
18681  __pyx_v_result->from_slice = __pyx_v_memviewslice;
18682 
18683  /* "View.MemoryView":1016
18684  *
18685  * result.from_slice = memviewslice
18686  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
18687  *
18688  * result.from_object = (<memoryview> memviewslice.memview).base
18689  */
18690  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
18691 
18692  /* "View.MemoryView":1018
18693  * __PYX_INC_MEMVIEW(&memviewslice, 1)
18694  *
18695  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
18696  * result.typeinfo = memviewslice.memview.typeinfo
18697  *
18698  */
18699  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
18700  __Pyx_GOTREF(__pyx_t_2);
18701  __Pyx_GIVEREF(__pyx_t_2);
18702  __Pyx_GOTREF(__pyx_v_result->from_object);
18703  __Pyx_DECREF(__pyx_v_result->from_object);
18704  __pyx_v_result->from_object = __pyx_t_2;
18705  __pyx_t_2 = 0;
18706 
18707  /* "View.MemoryView":1019
18708  *
18709  * result.from_object = (<memoryview> memviewslice.memview).base
18710  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
18711  *
18712  * result.view = memviewslice.memview.view
18713  */
18714  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
18715  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
18716 
18717  /* "View.MemoryView":1021
18718  * result.typeinfo = memviewslice.memview.typeinfo
18719  *
18720  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
18721  * result.view.buf = <void *> memviewslice.data
18722  * result.view.ndim = ndim
18723  */
18724  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
18725  __pyx_v_result->__pyx_base.view = __pyx_t_5;
18726 
18727  /* "View.MemoryView":1022
18728  *
18729  * result.view = memviewslice.memview.view
18730  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
18731  * result.view.ndim = ndim
18732  * (<__pyx_buffer *> &result.view).obj = Py_None
18733  */
18734  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
18735 
18736  /* "View.MemoryView":1023
18737  * result.view = memviewslice.memview.view
18738  * result.view.buf = <void *> memviewslice.data
18739  * result.view.ndim = ndim # <<<<<<<<<<<<<<
18740  * (<__pyx_buffer *> &result.view).obj = Py_None
18741  * Py_INCREF(Py_None)
18742  */
18743  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
18744 
18745  /* "View.MemoryView":1024
18746  * result.view.buf = <void *> memviewslice.data
18747  * result.view.ndim = ndim
18748  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
18749  * Py_INCREF(Py_None)
18750  *
18751  */
18752  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
18753 
18754  /* "View.MemoryView":1025
18755  * result.view.ndim = ndim
18756  * (<__pyx_buffer *> &result.view).obj = Py_None
18757  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
18758  *
18759  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18760  */
18761  Py_INCREF(Py_None);
18762 
18763  /* "View.MemoryView":1027
18764  * Py_INCREF(Py_None)
18765  *
18766  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18767  * result.flags = PyBUF_RECORDS
18768  * else:
18769  */
18770  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
18771  if (__pyx_t_1) {
18772 
18773  /* "View.MemoryView":1028
18774  *
18775  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18776  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
18777  * else:
18778  * result.flags = PyBUF_RECORDS_RO
18779  */
18780  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
18781 
18782  /* "View.MemoryView":1027
18783  * Py_INCREF(Py_None)
18784  *
18785  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18786  * result.flags = PyBUF_RECORDS
18787  * else:
18788  */
18789  goto __pyx_L4;
18790  }
18791 
18792  /* "View.MemoryView":1030
18793  * result.flags = PyBUF_RECORDS
18794  * else:
18795  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
18796  *
18797  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18798  */
18799  /*else*/ {
18800  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
18801  }
18802  __pyx_L4:;
18803 
18804  /* "View.MemoryView":1032
18805  * result.flags = PyBUF_RECORDS_RO
18806  *
18807  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
18808  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
18809  *
18810  */
18811  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
18812 
18813  /* "View.MemoryView":1033
18814  *
18815  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18816  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
18817  *
18818  *
18819  */
18820  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
18821 
18822  /* "View.MemoryView":1036
18823  *
18824  *
18825  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
18826  * for suboffset in result.from_slice.suboffsets[:ndim]:
18827  * if suboffset >= 0:
18828  */
18829  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
18830 
18831  /* "View.MemoryView":1037
18832  *
18833  * result.view.suboffsets = NULL
18834  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
18835  * if suboffset >= 0:
18836  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18837  */
18838  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
18839  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18840  __pyx_t_6 = __pyx_t_8;
18841  __pyx_v_suboffset = (__pyx_t_6[0]);
18842 
18843  /* "View.MemoryView":1038
18844  * result.view.suboffsets = NULL
18845  * for suboffset in result.from_slice.suboffsets[:ndim]:
18846  * if suboffset >= 0: # <<<<<<<<<<<<<<
18847  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18848  * break
18849  */
18850  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
18851  if (__pyx_t_1) {
18852 
18853  /* "View.MemoryView":1039
18854  * for suboffset in result.from_slice.suboffsets[:ndim]:
18855  * if suboffset >= 0:
18856  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
18857  * break
18858  *
18859  */
18860  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
18861 
18862  /* "View.MemoryView":1040
18863  * if suboffset >= 0:
18864  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18865  * break # <<<<<<<<<<<<<<
18866  *
18867  * result.view.len = result.view.itemsize
18868  */
18869  goto __pyx_L6_break;
18870 
18871  /* "View.MemoryView":1038
18872  * result.view.suboffsets = NULL
18873  * for suboffset in result.from_slice.suboffsets[:ndim]:
18874  * if suboffset >= 0: # <<<<<<<<<<<<<<
18875  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18876  * break
18877  */
18878  }
18879  }
18880  __pyx_L6_break:;
18881 
18882  /* "View.MemoryView":1042
18883  * break
18884  *
18885  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
18886  * for length in result.view.shape[:ndim]:
18887  * result.view.len *= length
18888  */
18889  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18890  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18891 
18892  /* "View.MemoryView":1043
18893  *
18894  * result.view.len = result.view.itemsize
18895  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
18896  * result.view.len *= length
18897  *
18898  */
18899  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18900  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18901  __pyx_t_6 = __pyx_t_8;
18902  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
18903  __Pyx_GOTREF(__pyx_t_2);
18904  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18905  __pyx_t_2 = 0;
18906 
18907  /* "View.MemoryView":1044
18908  * result.view.len = result.view.itemsize
18909  * for length in result.view.shape[:ndim]:
18910  * result.view.len *= length # <<<<<<<<<<<<<<
18911  *
18912  * result.to_object_func = to_object_func
18913  */
18914  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
18915  __Pyx_GOTREF(__pyx_t_2);
18916  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
18917  __Pyx_GOTREF(__pyx_t_3);
18918  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18919  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
18920  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18921  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18922  }
18923 
18924  /* "View.MemoryView":1046
18925  * result.view.len *= length
18926  *
18927  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
18928  * result.to_dtype_func = to_dtype_func
18929  *
18930  */
18931  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18932 
18933  /* "View.MemoryView":1047
18934  *
18935  * result.to_object_func = to_object_func
18936  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
18937  *
18938  * return result
18939  */
18940  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18941 
18942  /* "View.MemoryView":1049
18943  * result.to_dtype_func = to_dtype_func
18944  *
18945  * return result # <<<<<<<<<<<<<<
18946  *
18947  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18948  */
18949  __Pyx_XDECREF(__pyx_r);
18950  __Pyx_INCREF(((PyObject *)__pyx_v_result));
18951  __pyx_r = ((PyObject *)__pyx_v_result);
18952  goto __pyx_L0;
18953 
18954  /* "View.MemoryView":999
18955  *
18956  * @cname('__pyx_memoryview_fromslice')
18957  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18958  * int ndim,
18959  * object (*to_object_func)(char *),
18960  */
18961 
18962  /* function exit code */
18963  __pyx_L1_error:;
18964  __Pyx_XDECREF(__pyx_t_2);
18965  __Pyx_XDECREF(__pyx_t_3);
18966  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18967  __pyx_r = 0;
18968  __pyx_L0:;
18969  __Pyx_XDECREF((PyObject *)__pyx_v_result);
18970  __Pyx_XDECREF(__pyx_v_length);
18971  __Pyx_XGIVEREF(__pyx_r);
18972  __Pyx_RefNannyFinishContext();
18973  return __pyx_r;
18974 }
18975 
18976 /* "View.MemoryView":1052
18977  *
18978  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18979  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18980  * __Pyx_memviewslice *mslice) except NULL:
18981  * cdef _memoryviewslice obj
18982  */
18983 
18984 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18985  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18986  __Pyx_memviewslice *__pyx_r;
18987  __Pyx_RefNannyDeclarations
18988  int __pyx_t_1;
18989  int __pyx_t_2;
18990  PyObject *__pyx_t_3 = NULL;
18991  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
18992 
18993  /* "View.MemoryView":1055
18994  * __Pyx_memviewslice *mslice) except NULL:
18995  * cdef _memoryviewslice obj
18996  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18997  * obj = memview
18998  * return &obj.from_slice
18999  */
19000  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19001  __pyx_t_2 = (__pyx_t_1 != 0);
19002  if (__pyx_t_2) {
19003 
19004  /* "View.MemoryView":1056
19005  * cdef _memoryviewslice obj
19006  * if isinstance(memview, _memoryviewslice):
19007  * obj = memview # <<<<<<<<<<<<<<
19008  * return &obj.from_slice
19009  * else:
19010  */
19011  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
19012  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
19013  __Pyx_INCREF(__pyx_t_3);
19014  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
19015  __pyx_t_3 = 0;
19016 
19017  /* "View.MemoryView":1057
19018  * if isinstance(memview, _memoryviewslice):
19019  * obj = memview
19020  * return &obj.from_slice # <<<<<<<<<<<<<<
19021  * else:
19022  * slice_copy(memview, mslice)
19023  */
19024  __pyx_r = (&__pyx_v_obj->from_slice);
19025  goto __pyx_L0;
19026 
19027  /* "View.MemoryView":1055
19028  * __Pyx_memviewslice *mslice) except NULL:
19029  * cdef _memoryviewslice obj
19030  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19031  * obj = memview
19032  * return &obj.from_slice
19033  */
19034  }
19035 
19036  /* "View.MemoryView":1059
19037  * return &obj.from_slice
19038  * else:
19039  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
19040  * return mslice
19041  *
19042  */
19043  /*else*/ {
19044  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
19045 
19046  /* "View.MemoryView":1060
19047  * else:
19048  * slice_copy(memview, mslice)
19049  * return mslice # <<<<<<<<<<<<<<
19050  *
19051  * @cname('__pyx_memoryview_slice_copy')
19052  */
19053  __pyx_r = __pyx_v_mslice;
19054  goto __pyx_L0;
19055  }
19056 
19057  /* "View.MemoryView":1052
19058  *
19059  * @cname('__pyx_memoryview_get_slice_from_memoryview')
19060  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
19061  * __Pyx_memviewslice *mslice) except NULL:
19062  * cdef _memoryviewslice obj
19063  */
19064 
19065  /* function exit code */
19066  __pyx_L1_error:;
19067  __Pyx_XDECREF(__pyx_t_3);
19068  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
19069  __pyx_r = NULL;
19070  __pyx_L0:;
19071  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
19072  __Pyx_RefNannyFinishContext();
19073  return __pyx_r;
19074 }
19075 
19076 /* "View.MemoryView":1063
19077  *
19078  * @cname('__pyx_memoryview_slice_copy')
19079  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
19080  * cdef int dim
19081  * cdef (Py_ssize_t*) shape, strides, suboffsets
19082  */
19083 
19084 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
19085  int __pyx_v_dim;
19086  Py_ssize_t *__pyx_v_shape;
19087  Py_ssize_t *__pyx_v_strides;
19088  Py_ssize_t *__pyx_v_suboffsets;
19089  __Pyx_RefNannyDeclarations
19090  Py_ssize_t *__pyx_t_1;
19091  int __pyx_t_2;
19092  int __pyx_t_3;
19093  int __pyx_t_4;
19094  Py_ssize_t __pyx_t_5;
19095  __Pyx_RefNannySetupContext("slice_copy", 0);
19096 
19097  /* "View.MemoryView":1067
19098  * cdef (Py_ssize_t*) shape, strides, suboffsets
19099  *
19100  * shape = memview.view.shape # <<<<<<<<<<<<<<
19101  * strides = memview.view.strides
19102  * suboffsets = memview.view.suboffsets
19103  */
19104  __pyx_t_1 = __pyx_v_memview->view.shape;
19105  __pyx_v_shape = __pyx_t_1;
19106 
19107  /* "View.MemoryView":1068
19108  *
19109  * shape = memview.view.shape
19110  * strides = memview.view.strides # <<<<<<<<<<<<<<
19111  * suboffsets = memview.view.suboffsets
19112  *
19113  */
19114  __pyx_t_1 = __pyx_v_memview->view.strides;
19115  __pyx_v_strides = __pyx_t_1;
19116 
19117  /* "View.MemoryView":1069
19118  * shape = memview.view.shape
19119  * strides = memview.view.strides
19120  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
19121  *
19122  * dst.memview = <__pyx_memoryview *> memview
19123  */
19124  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
19125  __pyx_v_suboffsets = __pyx_t_1;
19126 
19127  /* "View.MemoryView":1071
19128  * suboffsets = memview.view.suboffsets
19129  *
19130  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
19131  * dst.data = <char *> memview.view.buf
19132  *
19133  */
19134  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
19135 
19136  /* "View.MemoryView":1072
19137  *
19138  * dst.memview = <__pyx_memoryview *> memview
19139  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
19140  *
19141  * for dim in range(memview.view.ndim):
19142  */
19143  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
19144 
19145  /* "View.MemoryView":1074
19146  * dst.data = <char *> memview.view.buf
19147  *
19148  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
19149  * dst.shape[dim] = shape[dim]
19150  * dst.strides[dim] = strides[dim]
19151  */
19152  __pyx_t_2 = __pyx_v_memview->view.ndim;
19153  __pyx_t_3 = __pyx_t_2;
19154  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19155  __pyx_v_dim = __pyx_t_4;
19156 
19157  /* "View.MemoryView":1075
19158  *
19159  * for dim in range(memview.view.ndim):
19160  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
19161  * dst.strides[dim] = strides[dim]
19162  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
19163  */
19164  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
19165 
19166  /* "View.MemoryView":1076
19167  * for dim in range(memview.view.ndim):
19168  * dst.shape[dim] = shape[dim]
19169  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
19170  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
19171  *
19172  */
19173  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
19174 
19175  /* "View.MemoryView":1077
19176  * dst.shape[dim] = shape[dim]
19177  * dst.strides[dim] = strides[dim]
19178  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
19179  *
19180  * @cname('__pyx_memoryview_copy_object')
19181  */
19182  if ((__pyx_v_suboffsets != 0)) {
19183  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
19184  } else {
19185  __pyx_t_5 = -1L;
19186  }
19187  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
19188  }
19189 
19190  /* "View.MemoryView":1063
19191  *
19192  * @cname('__pyx_memoryview_slice_copy')
19193  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
19194  * cdef int dim
19195  * cdef (Py_ssize_t*) shape, strides, suboffsets
19196  */
19197 
19198  /* function exit code */
19199  __Pyx_RefNannyFinishContext();
19200 }
19201 
19202 /* "View.MemoryView":1080
19203  *
19204  * @cname('__pyx_memoryview_copy_object')
19205  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
19206  * "Create a new memoryview object"
19207  * cdef __Pyx_memviewslice memviewslice
19208  */
19209 
19210 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
19211  __Pyx_memviewslice __pyx_v_memviewslice;
19212  PyObject *__pyx_r = NULL;
19213  __Pyx_RefNannyDeclarations
19214  PyObject *__pyx_t_1 = NULL;
19215  __Pyx_RefNannySetupContext("memoryview_copy", 0);
19216 
19217  /* "View.MemoryView":1083
19218  * "Create a new memoryview object"
19219  * cdef __Pyx_memviewslice memviewslice
19220  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
19221  * return memoryview_copy_from_slice(memview, &memviewslice)
19222  *
19223  */
19224  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
19225 
19226  /* "View.MemoryView":1084
19227  * cdef __Pyx_memviewslice memviewslice
19228  * slice_copy(memview, &memviewslice)
19229  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
19230  *
19231  * @cname('__pyx_memoryview_copy_object_from_slice')
19232  */
19233  __Pyx_XDECREF(__pyx_r);
19234  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
19235  __Pyx_GOTREF(__pyx_t_1);
19236  __pyx_r = __pyx_t_1;
19237  __pyx_t_1 = 0;
19238  goto __pyx_L0;
19239 
19240  /* "View.MemoryView":1080
19241  *
19242  * @cname('__pyx_memoryview_copy_object')
19243  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
19244  * "Create a new memoryview object"
19245  * cdef __Pyx_memviewslice memviewslice
19246  */
19247 
19248  /* function exit code */
19249  __pyx_L1_error:;
19250  __Pyx_XDECREF(__pyx_t_1);
19251  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
19252  __pyx_r = 0;
19253  __pyx_L0:;
19254  __Pyx_XGIVEREF(__pyx_r);
19255  __Pyx_RefNannyFinishContext();
19256  return __pyx_r;
19257 }
19258 
19259 /* "View.MemoryView":1087
19260  *
19261  * @cname('__pyx_memoryview_copy_object_from_slice')
19262  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
19263  * """
19264  * Create a new memoryview object from a given memoryview object and slice.
19265  */
19266 
19267 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
19268  PyObject *(*__pyx_v_to_object_func)(char *);
19269  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
19270  PyObject *__pyx_r = NULL;
19271  __Pyx_RefNannyDeclarations
19272  int __pyx_t_1;
19273  int __pyx_t_2;
19274  PyObject *(*__pyx_t_3)(char *);
19275  int (*__pyx_t_4)(char *, PyObject *);
19276  PyObject *__pyx_t_5 = NULL;
19277  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
19278 
19279  /* "View.MemoryView":1094
19280  * cdef int (*to_dtype_func)(char *, object) except 0
19281  *
19282  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19283  * to_object_func = (<_memoryviewslice> memview).to_object_func
19284  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
19285  */
19286  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19287  __pyx_t_2 = (__pyx_t_1 != 0);
19288  if (__pyx_t_2) {
19289 
19290  /* "View.MemoryView":1095
19291  *
19292  * if isinstance(memview, _memoryviewslice):
19293  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
19294  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
19295  * else:
19296  */
19297  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
19298  __pyx_v_to_object_func = __pyx_t_3;
19299 
19300  /* "View.MemoryView":1096
19301  * if isinstance(memview, _memoryviewslice):
19302  * to_object_func = (<_memoryviewslice> memview).to_object_func
19303  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
19304  * else:
19305  * to_object_func = NULL
19306  */
19307  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
19308  __pyx_v_to_dtype_func = __pyx_t_4;
19309 
19310  /* "View.MemoryView":1094
19311  * cdef int (*to_dtype_func)(char *, object) except 0
19312  *
19313  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19314  * to_object_func = (<_memoryviewslice> memview).to_object_func
19315  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
19316  */
19317  goto __pyx_L3;
19318  }
19319 
19320  /* "View.MemoryView":1098
19321  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
19322  * else:
19323  * to_object_func = NULL # <<<<<<<<<<<<<<
19324  * to_dtype_func = NULL
19325  *
19326  */
19327  /*else*/ {
19328  __pyx_v_to_object_func = NULL;
19329 
19330  /* "View.MemoryView":1099
19331  * else:
19332  * to_object_func = NULL
19333  * to_dtype_func = NULL # <<<<<<<<<<<<<<
19334  *
19335  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
19336  */
19337  __pyx_v_to_dtype_func = NULL;
19338  }
19339  __pyx_L3:;
19340 
19341  /* "View.MemoryView":1101
19342  * to_dtype_func = NULL
19343  *
19344  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
19345  * to_object_func, to_dtype_func,
19346  * memview.dtype_is_object)
19347  */
19348  __Pyx_XDECREF(__pyx_r);
19349 
19350  /* "View.MemoryView":1103
19351  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
19352  * to_object_func, to_dtype_func,
19353  * memview.dtype_is_object) # <<<<<<<<<<<<<<
19354  *
19355  *
19356  */
19357  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
19358  __Pyx_GOTREF(__pyx_t_5);
19359  __pyx_r = __pyx_t_5;
19360  __pyx_t_5 = 0;
19361  goto __pyx_L0;
19362 
19363  /* "View.MemoryView":1087
19364  *
19365  * @cname('__pyx_memoryview_copy_object_from_slice')
19366  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
19367  * """
19368  * Create a new memoryview object from a given memoryview object and slice.
19369  */
19370 
19371  /* function exit code */
19372  __pyx_L1_error:;
19373  __Pyx_XDECREF(__pyx_t_5);
19374  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19375  __pyx_r = 0;
19376  __pyx_L0:;
19377  __Pyx_XGIVEREF(__pyx_r);
19378  __Pyx_RefNannyFinishContext();
19379  return __pyx_r;
19380 }
19381 
19382 /* "View.MemoryView":1109
19383  *
19384  *
19385  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
19386  * if arg < 0:
19387  * return -arg
19388  */
19389 
19390 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
19391  Py_ssize_t __pyx_r;
19392  int __pyx_t_1;
19393 
19394  /* "View.MemoryView":1110
19395  *
19396  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
19397  * if arg < 0: # <<<<<<<<<<<<<<
19398  * return -arg
19399  * else:
19400  */
19401  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
19402  if (__pyx_t_1) {
19403 
19404  /* "View.MemoryView":1111
19405  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
19406  * if arg < 0:
19407  * return -arg # <<<<<<<<<<<<<<
19408  * else:
19409  * return arg
19410  */
19411  __pyx_r = (-__pyx_v_arg);
19412  goto __pyx_L0;
19413 
19414  /* "View.MemoryView":1110
19415  *
19416  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
19417  * if arg < 0: # <<<<<<<<<<<<<<
19418  * return -arg
19419  * else:
19420  */
19421  }
19422 
19423  /* "View.MemoryView":1113
19424  * return -arg
19425  * else:
19426  * return arg # <<<<<<<<<<<<<<
19427  *
19428  * @cname('__pyx_get_best_slice_order')
19429  */
19430  /*else*/ {
19431  __pyx_r = __pyx_v_arg;
19432  goto __pyx_L0;
19433  }
19434 
19435  /* "View.MemoryView":1109
19436  *
19437  *
19438  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
19439  * if arg < 0:
19440  * return -arg
19441  */
19442 
19443  /* function exit code */
19444  __pyx_L0:;
19445  return __pyx_r;
19446 }
19447 
19448 /* "View.MemoryView":1116
19449  *
19450  * @cname('__pyx_get_best_slice_order')
19451  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
19452  * """
19453  * Figure out the best memory access order for a given slice.
19454  */
19455 
19456 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
19457  int __pyx_v_i;
19458  Py_ssize_t __pyx_v_c_stride;
19459  Py_ssize_t __pyx_v_f_stride;
19460  char __pyx_r;
19461  int __pyx_t_1;
19462  int __pyx_t_2;
19463  int __pyx_t_3;
19464  int __pyx_t_4;
19465 
19466  /* "View.MemoryView":1121
19467  * """
19468  * cdef int i
19469  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
19470  * cdef Py_ssize_t f_stride = 0
19471  *
19472  */
19473  __pyx_v_c_stride = 0;
19474 
19475  /* "View.MemoryView":1122
19476  * cdef int i
19477  * cdef Py_ssize_t c_stride = 0
19478  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
19479  *
19480  * for i in range(ndim - 1, -1, -1):
19481  */
19482  __pyx_v_f_stride = 0;
19483 
19484  /* "View.MemoryView":1124
19485  * cdef Py_ssize_t f_stride = 0
19486  *
19487  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19488  * if mslice.shape[i] > 1:
19489  * c_stride = mslice.strides[i]
19490  */
19491  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19492  __pyx_v_i = __pyx_t_1;
19493 
19494  /* "View.MemoryView":1125
19495  *
19496  * for i in range(ndim - 1, -1, -1):
19497  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19498  * c_stride = mslice.strides[i]
19499  * break
19500  */
19501  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19502  if (__pyx_t_2) {
19503 
19504  /* "View.MemoryView":1126
19505  * for i in range(ndim - 1, -1, -1):
19506  * if mslice.shape[i] > 1:
19507  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
19508  * break
19509  *
19510  */
19511  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19512 
19513  /* "View.MemoryView":1127
19514  * if mslice.shape[i] > 1:
19515  * c_stride = mslice.strides[i]
19516  * break # <<<<<<<<<<<<<<
19517  *
19518  * for i in range(ndim):
19519  */
19520  goto __pyx_L4_break;
19521 
19522  /* "View.MemoryView":1125
19523  *
19524  * for i in range(ndim - 1, -1, -1):
19525  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19526  * c_stride = mslice.strides[i]
19527  * break
19528  */
19529  }
19530  }
19531  __pyx_L4_break:;
19532 
19533  /* "View.MemoryView":1129
19534  * break
19535  *
19536  * for i in range(ndim): # <<<<<<<<<<<<<<
19537  * if mslice.shape[i] > 1:
19538  * f_stride = mslice.strides[i]
19539  */
19540  __pyx_t_1 = __pyx_v_ndim;
19541  __pyx_t_3 = __pyx_t_1;
19542  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19543  __pyx_v_i = __pyx_t_4;
19544 
19545  /* "View.MemoryView":1130
19546  *
19547  * for i in range(ndim):
19548  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19549  * f_stride = mslice.strides[i]
19550  * break
19551  */
19552  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19553  if (__pyx_t_2) {
19554 
19555  /* "View.MemoryView":1131
19556  * for i in range(ndim):
19557  * if mslice.shape[i] > 1:
19558  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
19559  * break
19560  *
19561  */
19562  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19563 
19564  /* "View.MemoryView":1132
19565  * if mslice.shape[i] > 1:
19566  * f_stride = mslice.strides[i]
19567  * break # <<<<<<<<<<<<<<
19568  *
19569  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
19570  */
19571  goto __pyx_L7_break;
19572 
19573  /* "View.MemoryView":1130
19574  *
19575  * for i in range(ndim):
19576  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19577  * f_stride = mslice.strides[i]
19578  * break
19579  */
19580  }
19581  }
19582  __pyx_L7_break:;
19583 
19584  /* "View.MemoryView":1134
19585  * break
19586  *
19587  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
19588  * return 'C'
19589  * else:
19590  */
19591  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
19592  if (__pyx_t_2) {
19593 
19594  /* "View.MemoryView":1135
19595  *
19596  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
19597  * return 'C' # <<<<<<<<<<<<<<
19598  * else:
19599  * return 'F'
19600  */
19601  __pyx_r = 'C';
19602  goto __pyx_L0;
19603 
19604  /* "View.MemoryView":1134
19605  * break
19606  *
19607  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
19608  * return 'C'
19609  * else:
19610  */
19611  }
19612 
19613  /* "View.MemoryView":1137
19614  * return 'C'
19615  * else:
19616  * return 'F' # <<<<<<<<<<<<<<
19617  *
19618  * @cython.cdivision(True)
19619  */
19620  /*else*/ {
19621  __pyx_r = 'F';
19622  goto __pyx_L0;
19623  }
19624 
19625  /* "View.MemoryView":1116
19626  *
19627  * @cname('__pyx_get_best_slice_order')
19628  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
19629  * """
19630  * Figure out the best memory access order for a given slice.
19631  */
19632 
19633  /* function exit code */
19634  __pyx_L0:;
19635  return __pyx_r;
19636 }
19637 
19638 /* "View.MemoryView":1140
19639  *
19640  * @cython.cdivision(True)
19641  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19642  * char *dst_data, Py_ssize_t *dst_strides,
19643  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19644  */
19645 
19646 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19647  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19648  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
19649  Py_ssize_t __pyx_v_dst_extent;
19650  Py_ssize_t __pyx_v_src_stride;
19651  Py_ssize_t __pyx_v_dst_stride;
19652  int __pyx_t_1;
19653  int __pyx_t_2;
19654  int __pyx_t_3;
19655  Py_ssize_t __pyx_t_4;
19656  Py_ssize_t __pyx_t_5;
19657  Py_ssize_t __pyx_t_6;
19658 
19659  /* "View.MemoryView":1147
19660  *
19661  * cdef Py_ssize_t i
19662  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
19663  * cdef Py_ssize_t dst_extent = dst_shape[0]
19664  * cdef Py_ssize_t src_stride = src_strides[0]
19665  */
19666  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
19667 
19668  /* "View.MemoryView":1148
19669  * cdef Py_ssize_t i
19670  * cdef Py_ssize_t src_extent = src_shape[0]
19671  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
19672  * cdef Py_ssize_t src_stride = src_strides[0]
19673  * cdef Py_ssize_t dst_stride = dst_strides[0]
19674  */
19675  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
19676 
19677  /* "View.MemoryView":1149
19678  * cdef Py_ssize_t src_extent = src_shape[0]
19679  * cdef Py_ssize_t dst_extent = dst_shape[0]
19680  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
19681  * cdef Py_ssize_t dst_stride = dst_strides[0]
19682  *
19683  */
19684  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
19685 
19686  /* "View.MemoryView":1150
19687  * cdef Py_ssize_t dst_extent = dst_shape[0]
19688  * cdef Py_ssize_t src_stride = src_strides[0]
19689  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
19690  *
19691  * if ndim == 1:
19692  */
19693  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
19694 
19695  /* "View.MemoryView":1152
19696  * cdef Py_ssize_t dst_stride = dst_strides[0]
19697  *
19698  * if ndim == 1: # <<<<<<<<<<<<<<
19699  * if (src_stride > 0 and dst_stride > 0 and
19700  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19701  */
19702  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19703  if (__pyx_t_1) {
19704 
19705  /* "View.MemoryView":1153
19706  *
19707  * if ndim == 1:
19708  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19709  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19710  * memcpy(dst_data, src_data, itemsize * dst_extent)
19711  */
19712  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
19713  if (__pyx_t_2) {
19714  } else {
19715  __pyx_t_1 = __pyx_t_2;
19716  goto __pyx_L5_bool_binop_done;
19717  }
19718  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
19719  if (__pyx_t_2) {
19720  } else {
19721  __pyx_t_1 = __pyx_t_2;
19722  goto __pyx_L5_bool_binop_done;
19723  }
19724 
19725  /* "View.MemoryView":1154
19726  * if ndim == 1:
19727  * if (src_stride > 0 and dst_stride > 0 and
19728  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
19729  * memcpy(dst_data, src_data, itemsize * dst_extent)
19730  * else:
19731  */
19732  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
19733  if (__pyx_t_2) {
19734  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
19735  }
19736  __pyx_t_3 = (__pyx_t_2 != 0);
19737  __pyx_t_1 = __pyx_t_3;
19738  __pyx_L5_bool_binop_done:;
19739 
19740  /* "View.MemoryView":1153
19741  *
19742  * if ndim == 1:
19743  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19744  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19745  * memcpy(dst_data, src_data, itemsize * dst_extent)
19746  */
19747  if (__pyx_t_1) {
19748 
19749  /* "View.MemoryView":1155
19750  * if (src_stride > 0 and dst_stride > 0 and
19751  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19752  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
19753  * else:
19754  * for i in range(dst_extent):
19755  */
19756  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
19757 
19758  /* "View.MemoryView":1153
19759  *
19760  * if ndim == 1:
19761  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19762  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19763  * memcpy(dst_data, src_data, itemsize * dst_extent)
19764  */
19765  goto __pyx_L4;
19766  }
19767 
19768  /* "View.MemoryView":1157
19769  * memcpy(dst_data, src_data, itemsize * dst_extent)
19770  * else:
19771  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19772  * memcpy(dst_data, src_data, itemsize)
19773  * src_data += src_stride
19774  */
19775  /*else*/ {
19776  __pyx_t_4 = __pyx_v_dst_extent;
19777  __pyx_t_5 = __pyx_t_4;
19778  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19779  __pyx_v_i = __pyx_t_6;
19780 
19781  /* "View.MemoryView":1158
19782  * else:
19783  * for i in range(dst_extent):
19784  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
19785  * src_data += src_stride
19786  * dst_data += dst_stride
19787  */
19788  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
19789 
19790  /* "View.MemoryView":1159
19791  * for i in range(dst_extent):
19792  * memcpy(dst_data, src_data, itemsize)
19793  * src_data += src_stride # <<<<<<<<<<<<<<
19794  * dst_data += dst_stride
19795  * else:
19796  */
19797  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19798 
19799  /* "View.MemoryView":1160
19800  * memcpy(dst_data, src_data, itemsize)
19801  * src_data += src_stride
19802  * dst_data += dst_stride # <<<<<<<<<<<<<<
19803  * else:
19804  * for i in range(dst_extent):
19805  */
19806  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19807  }
19808  }
19809  __pyx_L4:;
19810 
19811  /* "View.MemoryView":1152
19812  * cdef Py_ssize_t dst_stride = dst_strides[0]
19813  *
19814  * if ndim == 1: # <<<<<<<<<<<<<<
19815  * if (src_stride > 0 and dst_stride > 0 and
19816  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19817  */
19818  goto __pyx_L3;
19819  }
19820 
19821  /* "View.MemoryView":1162
19822  * dst_data += dst_stride
19823  * else:
19824  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19825  * _copy_strided_to_strided(src_data, src_strides + 1,
19826  * dst_data, dst_strides + 1,
19827  */
19828  /*else*/ {
19829  __pyx_t_4 = __pyx_v_dst_extent;
19830  __pyx_t_5 = __pyx_t_4;
19831  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19832  __pyx_v_i = __pyx_t_6;
19833 
19834  /* "View.MemoryView":1163
19835  * else:
19836  * for i in range(dst_extent):
19837  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
19838  * dst_data, dst_strides + 1,
19839  * src_shape + 1, dst_shape + 1,
19840  */
19841  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
19842 
19843  /* "View.MemoryView":1167
19844  * src_shape + 1, dst_shape + 1,
19845  * ndim - 1, itemsize)
19846  * src_data += src_stride # <<<<<<<<<<<<<<
19847  * dst_data += dst_stride
19848  *
19849  */
19850  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19851 
19852  /* "View.MemoryView":1168
19853  * ndim - 1, itemsize)
19854  * src_data += src_stride
19855  * dst_data += dst_stride # <<<<<<<<<<<<<<
19856  *
19857  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
19858  */
19859  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19860  }
19861  }
19862  __pyx_L3:;
19863 
19864  /* "View.MemoryView":1140
19865  *
19866  * @cython.cdivision(True)
19867  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19868  * char *dst_data, Py_ssize_t *dst_strides,
19869  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19870  */
19871 
19872  /* function exit code */
19873 }
19874 
19875 /* "View.MemoryView":1170
19876  * dst_data += dst_stride
19877  *
19878  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19879  * __Pyx_memviewslice *dst,
19880  * int ndim, size_t itemsize) nogil:
19881  */
19882 
19883 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19884 
19885  /* "View.MemoryView":1173
19886  * __Pyx_memviewslice *dst,
19887  * int ndim, size_t itemsize) nogil:
19888  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
19889  * src.shape, dst.shape, ndim, itemsize)
19890  *
19891  */
19892  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
19893 
19894  /* "View.MemoryView":1170
19895  * dst_data += dst_stride
19896  *
19897  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19898  * __Pyx_memviewslice *dst,
19899  * int ndim, size_t itemsize) nogil:
19900  */
19901 
19902  /* function exit code */
19903 }
19904 
19905 /* "View.MemoryView":1177
19906  *
19907  * @cname('__pyx_memoryview_slice_get_size')
19908  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19909  * "Return the size of the memory occupied by the slice in number of bytes"
19910  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19911  */
19912 
19913 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
19914  Py_ssize_t __pyx_v_shape;
19915  Py_ssize_t __pyx_v_size;
19916  Py_ssize_t __pyx_r;
19917  Py_ssize_t __pyx_t_1;
19918  Py_ssize_t *__pyx_t_2;
19919  Py_ssize_t *__pyx_t_3;
19920  Py_ssize_t *__pyx_t_4;
19921 
19922  /* "View.MemoryView":1179
19923  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
19924  * "Return the size of the memory occupied by the slice in number of bytes"
19925  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
19926  *
19927  * for shape in src.shape[:ndim]:
19928  */
19929  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19930  __pyx_v_size = __pyx_t_1;
19931 
19932  /* "View.MemoryView":1181
19933  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19934  *
19935  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
19936  * size *= shape
19937  *
19938  */
19939  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
19940  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
19941  __pyx_t_2 = __pyx_t_4;
19942  __pyx_v_shape = (__pyx_t_2[0]);
19943 
19944  /* "View.MemoryView":1182
19945  *
19946  * for shape in src.shape[:ndim]:
19947  * size *= shape # <<<<<<<<<<<<<<
19948  *
19949  * return size
19950  */
19951  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
19952  }
19953 
19954  /* "View.MemoryView":1184
19955  * size *= shape
19956  *
19957  * return size # <<<<<<<<<<<<<<
19958  *
19959  * @cname('__pyx_fill_contig_strides_array')
19960  */
19961  __pyx_r = __pyx_v_size;
19962  goto __pyx_L0;
19963 
19964  /* "View.MemoryView":1177
19965  *
19966  * @cname('__pyx_memoryview_slice_get_size')
19967  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19968  * "Return the size of the memory occupied by the slice in number of bytes"
19969  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19970  */
19971 
19972  /* function exit code */
19973  __pyx_L0:;
19974  return __pyx_r;
19975 }
19976 
19977 /* "View.MemoryView":1187
19978  *
19979  * @cname('__pyx_fill_contig_strides_array')
19980  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19981  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19982  * int ndim, char order) nogil:
19983  */
19984 
19985 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
19986  int __pyx_v_idx;
19987  Py_ssize_t __pyx_r;
19988  int __pyx_t_1;
19989  int __pyx_t_2;
19990  int __pyx_t_3;
19991  int __pyx_t_4;
19992 
19993  /* "View.MemoryView":1196
19994  * cdef int idx
19995  *
19996  * if order == 'F': # <<<<<<<<<<<<<<
19997  * for idx in range(ndim):
19998  * strides[idx] = stride
19999  */
20000  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
20001  if (__pyx_t_1) {
20002 
20003  /* "View.MemoryView":1197
20004  *
20005  * if order == 'F':
20006  * for idx in range(ndim): # <<<<<<<<<<<<<<
20007  * strides[idx] = stride
20008  * stride *= shape[idx]
20009  */
20010  __pyx_t_2 = __pyx_v_ndim;
20011  __pyx_t_3 = __pyx_t_2;
20012  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20013  __pyx_v_idx = __pyx_t_4;
20014 
20015  /* "View.MemoryView":1198
20016  * if order == 'F':
20017  * for idx in range(ndim):
20018  * strides[idx] = stride # <<<<<<<<<<<<<<
20019  * stride *= shape[idx]
20020  * else:
20021  */
20022  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
20023 
20024  /* "View.MemoryView":1199
20025  * for idx in range(ndim):
20026  * strides[idx] = stride
20027  * stride *= shape[idx] # <<<<<<<<<<<<<<
20028  * else:
20029  * for idx in range(ndim - 1, -1, -1):
20030  */
20031  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
20032  }
20033 
20034  /* "View.MemoryView":1196
20035  * cdef int idx
20036  *
20037  * if order == 'F': # <<<<<<<<<<<<<<
20038  * for idx in range(ndim):
20039  * strides[idx] = stride
20040  */
20041  goto __pyx_L3;
20042  }
20043 
20044  /* "View.MemoryView":1201
20045  * stride *= shape[idx]
20046  * else:
20047  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20048  * strides[idx] = stride
20049  * stride *= shape[idx]
20050  */
20051  /*else*/ {
20052  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
20053  __pyx_v_idx = __pyx_t_2;
20054 
20055  /* "View.MemoryView":1202
20056  * else:
20057  * for idx in range(ndim - 1, -1, -1):
20058  * strides[idx] = stride # <<<<<<<<<<<<<<
20059  * stride *= shape[idx]
20060  *
20061  */
20062  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
20063 
20064  /* "View.MemoryView":1203
20065  * for idx in range(ndim - 1, -1, -1):
20066  * strides[idx] = stride
20067  * stride *= shape[idx] # <<<<<<<<<<<<<<
20068  *
20069  * return stride
20070  */
20071  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
20072  }
20073  }
20074  __pyx_L3:;
20075 
20076  /* "View.MemoryView":1205
20077  * stride *= shape[idx]
20078  *
20079  * return stride # <<<<<<<<<<<<<<
20080  *
20081  * @cname('__pyx_memoryview_copy_data_to_temp')
20082  */
20083  __pyx_r = __pyx_v_stride;
20084  goto __pyx_L0;
20085 
20086  /* "View.MemoryView":1187
20087  *
20088  * @cname('__pyx_fill_contig_strides_array')
20089  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
20090  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
20091  * int ndim, char order) nogil:
20092  */
20093 
20094  /* function exit code */
20095  __pyx_L0:;
20096  return __pyx_r;
20097 }
20098 
20099 /* "View.MemoryView":1208
20100  *
20101  * @cname('__pyx_memoryview_copy_data_to_temp')
20102  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
20103  * __Pyx_memviewslice *tmpslice,
20104  * char order,
20105  */
20106 
20107 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
20108  int __pyx_v_i;
20109  void *__pyx_v_result;
20110  size_t __pyx_v_itemsize;
20111  size_t __pyx_v_size;
20112  void *__pyx_r;
20113  Py_ssize_t __pyx_t_1;
20114  int __pyx_t_2;
20115  int __pyx_t_3;
20116  struct __pyx_memoryview_obj *__pyx_t_4;
20117  int __pyx_t_5;
20118  int __pyx_t_6;
20119 
20120  /* "View.MemoryView":1219
20121  * cdef void *result
20122  *
20123  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
20124  * cdef size_t size = slice_get_size(src, ndim)
20125  *
20126  */
20127  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
20128  __pyx_v_itemsize = __pyx_t_1;
20129 
20130  /* "View.MemoryView":1220
20131  *
20132  * cdef size_t itemsize = src.memview.view.itemsize
20133  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
20134  *
20135  * result = malloc(size)
20136  */
20137  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
20138 
20139  /* "View.MemoryView":1222
20140  * cdef size_t size = slice_get_size(src, ndim)
20141  *
20142  * result = malloc(size) # <<<<<<<<<<<<<<
20143  * if not result:
20144  * _err(MemoryError, NULL)
20145  */
20146  __pyx_v_result = malloc(__pyx_v_size);
20147 
20148  /* "View.MemoryView":1223
20149  *
20150  * result = malloc(size)
20151  * if not result: # <<<<<<<<<<<<<<
20152  * _err(MemoryError, NULL)
20153  *
20154  */
20155  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
20156  if (__pyx_t_2) {
20157 
20158  /* "View.MemoryView":1224
20159  * result = malloc(size)
20160  * if not result:
20161  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
20162  *
20163  *
20164  */
20165  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
20166 
20167  /* "View.MemoryView":1223
20168  *
20169  * result = malloc(size)
20170  * if not result: # <<<<<<<<<<<<<<
20171  * _err(MemoryError, NULL)
20172  *
20173  */
20174  }
20175 
20176  /* "View.MemoryView":1227
20177  *
20178  *
20179  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
20180  * tmpslice.memview = src.memview
20181  * for i in range(ndim):
20182  */
20183  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
20184 
20185  /* "View.MemoryView":1228
20186  *
20187  * tmpslice.data = <char *> result
20188  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
20189  * for i in range(ndim):
20190  * tmpslice.shape[i] = src.shape[i]
20191  */
20192  __pyx_t_4 = __pyx_v_src->memview;
20193  __pyx_v_tmpslice->memview = __pyx_t_4;
20194 
20195  /* "View.MemoryView":1229
20196  * tmpslice.data = <char *> result
20197  * tmpslice.memview = src.memview
20198  * for i in range(ndim): # <<<<<<<<<<<<<<
20199  * tmpslice.shape[i] = src.shape[i]
20200  * tmpslice.suboffsets[i] = -1
20201  */
20202  __pyx_t_3 = __pyx_v_ndim;
20203  __pyx_t_5 = __pyx_t_3;
20204  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20205  __pyx_v_i = __pyx_t_6;
20206 
20207  /* "View.MemoryView":1230
20208  * tmpslice.memview = src.memview
20209  * for i in range(ndim):
20210  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
20211  * tmpslice.suboffsets[i] = -1
20212  *
20213  */
20214  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
20215 
20216  /* "View.MemoryView":1231
20217  * for i in range(ndim):
20218  * tmpslice.shape[i] = src.shape[i]
20219  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20220  *
20221  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
20222  */
20223  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
20224  }
20225 
20226  /* "View.MemoryView":1233
20227  * tmpslice.suboffsets[i] = -1
20228  *
20229  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
20230  * ndim, order)
20231  *
20232  */
20233  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
20234 
20235  /* "View.MemoryView":1237
20236  *
20237  *
20238  * for i in range(ndim): # <<<<<<<<<<<<<<
20239  * if tmpslice.shape[i] == 1:
20240  * tmpslice.strides[i] = 0
20241  */
20242  __pyx_t_3 = __pyx_v_ndim;
20243  __pyx_t_5 = __pyx_t_3;
20244  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20245  __pyx_v_i = __pyx_t_6;
20246 
20247  /* "View.MemoryView":1238
20248  *
20249  * for i in range(ndim):
20250  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
20251  * tmpslice.strides[i] = 0
20252  *
20253  */
20254  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
20255  if (__pyx_t_2) {
20256 
20257  /* "View.MemoryView":1239
20258  * for i in range(ndim):
20259  * if tmpslice.shape[i] == 1:
20260  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
20261  *
20262  * if slice_is_contig(src[0], order, ndim):
20263  */
20264  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
20265 
20266  /* "View.MemoryView":1238
20267  *
20268  * for i in range(ndim):
20269  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
20270  * tmpslice.strides[i] = 0
20271  *
20272  */
20273  }
20274  }
20275 
20276  /* "View.MemoryView":1241
20277  * tmpslice.strides[i] = 0
20278  *
20279  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
20280  * memcpy(result, src.data, size)
20281  * else:
20282  */
20283  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
20284  if (__pyx_t_2) {
20285 
20286  /* "View.MemoryView":1242
20287  *
20288  * if slice_is_contig(src[0], order, ndim):
20289  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
20290  * else:
20291  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
20292  */
20293  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
20294 
20295  /* "View.MemoryView":1241
20296  * tmpslice.strides[i] = 0
20297  *
20298  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
20299  * memcpy(result, src.data, size)
20300  * else:
20301  */
20302  goto __pyx_L9;
20303  }
20304 
20305  /* "View.MemoryView":1244
20306  * memcpy(result, src.data, size)
20307  * else:
20308  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
20309  *
20310  * return result
20311  */
20312  /*else*/ {
20313  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
20314  }
20315  __pyx_L9:;
20316 
20317  /* "View.MemoryView":1246
20318  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
20319  *
20320  * return result # <<<<<<<<<<<<<<
20321  *
20322  *
20323  */
20324  __pyx_r = __pyx_v_result;
20325  goto __pyx_L0;
20326 
20327  /* "View.MemoryView":1208
20328  *
20329  * @cname('__pyx_memoryview_copy_data_to_temp')
20330  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
20331  * __Pyx_memviewslice *tmpslice,
20332  * char order,
20333  */
20334 
20335  /* function exit code */
20336  __pyx_L1_error:;
20337  {
20338  #ifdef WITH_THREAD
20339  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20340  #endif
20341  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
20342  #ifdef WITH_THREAD
20343  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20344  #endif
20345  }
20346  __pyx_r = NULL;
20347  __pyx_L0:;
20348  return __pyx_r;
20349 }
20350 
20351 /* "View.MemoryView":1251
20352  *
20353  * @cname('__pyx_memoryview_err_extents')
20354  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
20355  * Py_ssize_t extent2) except -1 with gil:
20356  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
20357  */
20358 
20359 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
20360  int __pyx_r;
20361  __Pyx_RefNannyDeclarations
20362  PyObject *__pyx_t_1 = NULL;
20363  PyObject *__pyx_t_2 = NULL;
20364  PyObject *__pyx_t_3 = NULL;
20365  PyObject *__pyx_t_4 = NULL;
20366  #ifdef WITH_THREAD
20367  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20368  #endif
20369  __Pyx_RefNannySetupContext("_err_extents", 0);
20370 
20371  /* "View.MemoryView":1254
20372  * Py_ssize_t extent2) except -1 with gil:
20373  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
20374  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
20375  *
20376  * @cname('__pyx_memoryview_err_dim')
20377  */
20378  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
20379  __Pyx_GOTREF(__pyx_t_1);
20380  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
20381  __Pyx_GOTREF(__pyx_t_2);
20382  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
20383  __Pyx_GOTREF(__pyx_t_3);
20384  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
20385  __Pyx_GOTREF(__pyx_t_4);
20386  __Pyx_GIVEREF(__pyx_t_1);
20387  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
20388  __Pyx_GIVEREF(__pyx_t_2);
20389  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
20390  __Pyx_GIVEREF(__pyx_t_3);
20391  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
20392  __pyx_t_1 = 0;
20393  __pyx_t_2 = 0;
20394  __pyx_t_3 = 0;
20395 
20396  /* "View.MemoryView":1253
20397  * cdef int _err_extents(int i, Py_ssize_t extent1,
20398  * Py_ssize_t extent2) except -1 with gil:
20399  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
20400  * (i, extent1, extent2))
20401  *
20402  */
20403  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
20404  __Pyx_GOTREF(__pyx_t_3);
20405  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20406  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
20407  __Pyx_GOTREF(__pyx_t_4);
20408  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20409  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20410  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20411  __PYX_ERR(1, 1253, __pyx_L1_error)
20412 
20413  /* "View.MemoryView":1251
20414  *
20415  * @cname('__pyx_memoryview_err_extents')
20416  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
20417  * Py_ssize_t extent2) except -1 with gil:
20418  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
20419  */
20420 
20421  /* function exit code */
20422  __pyx_L1_error:;
20423  __Pyx_XDECREF(__pyx_t_1);
20424  __Pyx_XDECREF(__pyx_t_2);
20425  __Pyx_XDECREF(__pyx_t_3);
20426  __Pyx_XDECREF(__pyx_t_4);
20427  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20428  __pyx_r = -1;
20429  __Pyx_RefNannyFinishContext();
20430  #ifdef WITH_THREAD
20431  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20432  #endif
20433  return __pyx_r;
20434 }
20435 
20436 /* "View.MemoryView":1257
20437  *
20438  * @cname('__pyx_memoryview_err_dim')
20439  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
20440  * raise error(msg.decode('ascii') % dim)
20441  *
20442  */
20443 
20444 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
20445  int __pyx_r;
20446  __Pyx_RefNannyDeclarations
20447  PyObject *__pyx_t_1 = NULL;
20448  PyObject *__pyx_t_2 = NULL;
20449  PyObject *__pyx_t_3 = NULL;
20450  PyObject *__pyx_t_4 = NULL;
20451  #ifdef WITH_THREAD
20452  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20453  #endif
20454  __Pyx_RefNannySetupContext("_err_dim", 0);
20455  __Pyx_INCREF(__pyx_v_error);
20456 
20457  /* "View.MemoryView":1258
20458  * @cname('__pyx_memoryview_err_dim')
20459  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
20460  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
20461  *
20462  * @cname('__pyx_memoryview_err')
20463  */
20464  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
20465  __Pyx_GOTREF(__pyx_t_2);
20466  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
20467  __Pyx_GOTREF(__pyx_t_3);
20468  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
20469  __Pyx_GOTREF(__pyx_t_4);
20470  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20471  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20472  __Pyx_INCREF(__pyx_v_error);
20473  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
20474  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
20475  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
20476  if (likely(__pyx_t_2)) {
20477  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
20478  __Pyx_INCREF(__pyx_t_2);
20479  __Pyx_INCREF(function);
20480  __Pyx_DECREF_SET(__pyx_t_3, function);
20481  }
20482  }
20483  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
20484  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20485  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20486  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
20487  __Pyx_GOTREF(__pyx_t_1);
20488  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20489  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20490  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20491  __PYX_ERR(1, 1258, __pyx_L1_error)
20492 
20493  /* "View.MemoryView":1257
20494  *
20495  * @cname('__pyx_memoryview_err_dim')
20496  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
20497  * raise error(msg.decode('ascii') % dim)
20498  *
20499  */
20500 
20501  /* function exit code */
20502  __pyx_L1_error:;
20503  __Pyx_XDECREF(__pyx_t_1);
20504  __Pyx_XDECREF(__pyx_t_2);
20505  __Pyx_XDECREF(__pyx_t_3);
20506  __Pyx_XDECREF(__pyx_t_4);
20507  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
20508  __pyx_r = -1;
20509  __Pyx_XDECREF(__pyx_v_error);
20510  __Pyx_RefNannyFinishContext();
20511  #ifdef WITH_THREAD
20512  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20513  #endif
20514  return __pyx_r;
20515 }
20516 
20517 /* "View.MemoryView":1261
20518  *
20519  * @cname('__pyx_memoryview_err')
20520  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
20521  * if msg != NULL:
20522  * raise error(msg.decode('ascii'))
20523  */
20524 
20525 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
20526  int __pyx_r;
20527  __Pyx_RefNannyDeclarations
20528  int __pyx_t_1;
20529  PyObject *__pyx_t_2 = NULL;
20530  PyObject *__pyx_t_3 = NULL;
20531  PyObject *__pyx_t_4 = NULL;
20532  PyObject *__pyx_t_5 = NULL;
20533  #ifdef WITH_THREAD
20534  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20535  #endif
20536  __Pyx_RefNannySetupContext("_err", 0);
20537  __Pyx_INCREF(__pyx_v_error);
20538 
20539  /* "View.MemoryView":1262
20540  * @cname('__pyx_memoryview_err')
20541  * cdef int _err(object error, char *msg) except -1 with gil:
20542  * if msg != NULL: # <<<<<<<<<<<<<<
20543  * raise error(msg.decode('ascii'))
20544  * else:
20545  */
20546  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
20547  if (unlikely(__pyx_t_1)) {
20548 
20549  /* "View.MemoryView":1263
20550  * cdef int _err(object error, char *msg) except -1 with gil:
20551  * if msg != NULL:
20552  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
20553  * else:
20554  * raise error
20555  */
20556  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
20557  __Pyx_GOTREF(__pyx_t_3);
20558  __Pyx_INCREF(__pyx_v_error);
20559  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
20560  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
20561  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20562  if (likely(__pyx_t_5)) {
20563  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
20564  __Pyx_INCREF(__pyx_t_5);
20565  __Pyx_INCREF(function);
20566  __Pyx_DECREF_SET(__pyx_t_4, function);
20567  }
20568  }
20569  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
20570  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20571  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20572  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
20573  __Pyx_GOTREF(__pyx_t_2);
20574  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20575  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
20576  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20577  __PYX_ERR(1, 1263, __pyx_L1_error)
20578 
20579  /* "View.MemoryView":1262
20580  * @cname('__pyx_memoryview_err')
20581  * cdef int _err(object error, char *msg) except -1 with gil:
20582  * if msg != NULL: # <<<<<<<<<<<<<<
20583  * raise error(msg.decode('ascii'))
20584  * else:
20585  */
20586  }
20587 
20588  /* "View.MemoryView":1265
20589  * raise error(msg.decode('ascii'))
20590  * else:
20591  * raise error # <<<<<<<<<<<<<<
20592  *
20593  * @cname('__pyx_memoryview_copy_contents')
20594  */
20595  /*else*/ {
20596  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
20597  __PYX_ERR(1, 1265, __pyx_L1_error)
20598  }
20599 
20600  /* "View.MemoryView":1261
20601  *
20602  * @cname('__pyx_memoryview_err')
20603  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
20604  * if msg != NULL:
20605  * raise error(msg.decode('ascii'))
20606  */
20607 
20608  /* function exit code */
20609  __pyx_L1_error:;
20610  __Pyx_XDECREF(__pyx_t_2);
20611  __Pyx_XDECREF(__pyx_t_3);
20612  __Pyx_XDECREF(__pyx_t_4);
20613  __Pyx_XDECREF(__pyx_t_5);
20614  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
20615  __pyx_r = -1;
20616  __Pyx_XDECREF(__pyx_v_error);
20617  __Pyx_RefNannyFinishContext();
20618  #ifdef WITH_THREAD
20619  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20620  #endif
20621  return __pyx_r;
20622 }
20623 
20624 /* "View.MemoryView":1268
20625  *
20626  * @cname('__pyx_memoryview_copy_contents')
20627  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20628  * __Pyx_memviewslice dst,
20629  * int src_ndim, int dst_ndim,
20630  */
20631 
20632 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
20633  void *__pyx_v_tmpdata;
20634  size_t __pyx_v_itemsize;
20635  int __pyx_v_i;
20636  char __pyx_v_order;
20637  int __pyx_v_broadcasting;
20638  int __pyx_v_direct_copy;
20639  __Pyx_memviewslice __pyx_v_tmp;
20640  int __pyx_v_ndim;
20641  int __pyx_r;
20642  Py_ssize_t __pyx_t_1;
20643  int __pyx_t_2;
20644  int __pyx_t_3;
20645  int __pyx_t_4;
20646  int __pyx_t_5;
20647  int __pyx_t_6;
20648  void *__pyx_t_7;
20649  int __pyx_t_8;
20650 
20651  /* "View.MemoryView":1276
20652  * Check for overlapping memory and verify the shapes.
20653  * """
20654  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
20655  * cdef size_t itemsize = src.memview.view.itemsize
20656  * cdef int i
20657  */
20658  __pyx_v_tmpdata = NULL;
20659 
20660  /* "View.MemoryView":1277
20661  * """
20662  * cdef void *tmpdata = NULL
20663  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
20664  * cdef int i
20665  * cdef char order = get_best_order(&src, src_ndim)
20666  */
20667  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
20668  __pyx_v_itemsize = __pyx_t_1;
20669 
20670  /* "View.MemoryView":1279
20671  * cdef size_t itemsize = src.memview.view.itemsize
20672  * cdef int i
20673  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
20674  * cdef bint broadcasting = False
20675  * cdef bint direct_copy = False
20676  */
20677  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
20678 
20679  /* "View.MemoryView":1280
20680  * cdef int i
20681  * cdef char order = get_best_order(&src, src_ndim)
20682  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
20683  * cdef bint direct_copy = False
20684  * cdef __Pyx_memviewslice tmp
20685  */
20686  __pyx_v_broadcasting = 0;
20687 
20688  /* "View.MemoryView":1281
20689  * cdef char order = get_best_order(&src, src_ndim)
20690  * cdef bint broadcasting = False
20691  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
20692  * cdef __Pyx_memviewslice tmp
20693  *
20694  */
20695  __pyx_v_direct_copy = 0;
20696 
20697  /* "View.MemoryView":1284
20698  * cdef __Pyx_memviewslice tmp
20699  *
20700  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
20701  * broadcast_leading(&src, src_ndim, dst_ndim)
20702  * elif dst_ndim < src_ndim:
20703  */
20704  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
20705  if (__pyx_t_2) {
20706 
20707  /* "View.MemoryView":1285
20708  *
20709  * if src_ndim < dst_ndim:
20710  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
20711  * elif dst_ndim < src_ndim:
20712  * broadcast_leading(&dst, dst_ndim, src_ndim)
20713  */
20714  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
20715 
20716  /* "View.MemoryView":1284
20717  * cdef __Pyx_memviewslice tmp
20718  *
20719  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
20720  * broadcast_leading(&src, src_ndim, dst_ndim)
20721  * elif dst_ndim < src_ndim:
20722  */
20723  goto __pyx_L3;
20724  }
20725 
20726  /* "View.MemoryView":1286
20727  * if src_ndim < dst_ndim:
20728  * broadcast_leading(&src, src_ndim, dst_ndim)
20729  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20730  * broadcast_leading(&dst, dst_ndim, src_ndim)
20731  *
20732  */
20733  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
20734  if (__pyx_t_2) {
20735 
20736  /* "View.MemoryView":1287
20737  * broadcast_leading(&src, src_ndim, dst_ndim)
20738  * elif dst_ndim < src_ndim:
20739  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
20740  *
20741  * cdef int ndim = max(src_ndim, dst_ndim)
20742  */
20743  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
20744 
20745  /* "View.MemoryView":1286
20746  * if src_ndim < dst_ndim:
20747  * broadcast_leading(&src, src_ndim, dst_ndim)
20748  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20749  * broadcast_leading(&dst, dst_ndim, src_ndim)
20750  *
20751  */
20752  }
20753  __pyx_L3:;
20754 
20755  /* "View.MemoryView":1289
20756  * broadcast_leading(&dst, dst_ndim, src_ndim)
20757  *
20758  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
20759  *
20760  * for i in range(ndim):
20761  */
20762  __pyx_t_3 = __pyx_v_dst_ndim;
20763  __pyx_t_4 = __pyx_v_src_ndim;
20764  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
20765  __pyx_t_5 = __pyx_t_3;
20766  } else {
20767  __pyx_t_5 = __pyx_t_4;
20768  }
20769  __pyx_v_ndim = __pyx_t_5;
20770 
20771  /* "View.MemoryView":1291
20772  * cdef int ndim = max(src_ndim, dst_ndim)
20773  *
20774  * for i in range(ndim): # <<<<<<<<<<<<<<
20775  * if src.shape[i] != dst.shape[i]:
20776  * if src.shape[i] == 1:
20777  */
20778  __pyx_t_5 = __pyx_v_ndim;
20779  __pyx_t_3 = __pyx_t_5;
20780  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20781  __pyx_v_i = __pyx_t_4;
20782 
20783  /* "View.MemoryView":1292
20784  *
20785  * for i in range(ndim):
20786  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20787  * if src.shape[i] == 1:
20788  * broadcasting = True
20789  */
20790  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
20791  if (__pyx_t_2) {
20792 
20793  /* "View.MemoryView":1293
20794  * for i in range(ndim):
20795  * if src.shape[i] != dst.shape[i]:
20796  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20797  * broadcasting = True
20798  * src.strides[i] = 0
20799  */
20800  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
20801  if (__pyx_t_2) {
20802 
20803  /* "View.MemoryView":1294
20804  * if src.shape[i] != dst.shape[i]:
20805  * if src.shape[i] == 1:
20806  * broadcasting = True # <<<<<<<<<<<<<<
20807  * src.strides[i] = 0
20808  * else:
20809  */
20810  __pyx_v_broadcasting = 1;
20811 
20812  /* "View.MemoryView":1295
20813  * if src.shape[i] == 1:
20814  * broadcasting = True
20815  * src.strides[i] = 0 # <<<<<<<<<<<<<<
20816  * else:
20817  * _err_extents(i, dst.shape[i], src.shape[i])
20818  */
20819  (__pyx_v_src.strides[__pyx_v_i]) = 0;
20820 
20821  /* "View.MemoryView":1293
20822  * for i in range(ndim):
20823  * if src.shape[i] != dst.shape[i]:
20824  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20825  * broadcasting = True
20826  * src.strides[i] = 0
20827  */
20828  goto __pyx_L7;
20829  }
20830 
20831  /* "View.MemoryView":1297
20832  * src.strides[i] = 0
20833  * else:
20834  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
20835  *
20836  * if src.suboffsets[i] >= 0:
20837  */
20838  /*else*/ {
20839  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
20840  }
20841  __pyx_L7:;
20842 
20843  /* "View.MemoryView":1292
20844  *
20845  * for i in range(ndim):
20846  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20847  * if src.shape[i] == 1:
20848  * broadcasting = True
20849  */
20850  }
20851 
20852  /* "View.MemoryView":1299
20853  * _err_extents(i, dst.shape[i], src.shape[i])
20854  *
20855  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20856  * _err_dim(ValueError, "Dimension %d is not direct", i)
20857  *
20858  */
20859  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20860  if (__pyx_t_2) {
20861 
20862  /* "View.MemoryView":1300
20863  *
20864  * if src.suboffsets[i] >= 0:
20865  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
20866  *
20867  * if slices_overlap(&src, &dst, ndim, itemsize):
20868  */
20869  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
20870 
20871  /* "View.MemoryView":1299
20872  * _err_extents(i, dst.shape[i], src.shape[i])
20873  *
20874  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20875  * _err_dim(ValueError, "Dimension %d is not direct", i)
20876  *
20877  */
20878  }
20879  }
20880 
20881  /* "View.MemoryView":1302
20882  * _err_dim(ValueError, "Dimension %d is not direct", i)
20883  *
20884  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20885  *
20886  * if not slice_is_contig(src, order, ndim):
20887  */
20888  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20889  if (__pyx_t_2) {
20890 
20891  /* "View.MemoryView":1304
20892  * if slices_overlap(&src, &dst, ndim, itemsize):
20893  *
20894  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20895  * order = get_best_order(&dst, ndim)
20896  *
20897  */
20898  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20899  if (__pyx_t_2) {
20900 
20901  /* "View.MemoryView":1305
20902  *
20903  * if not slice_is_contig(src, order, ndim):
20904  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
20905  *
20906  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20907  */
20908  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20909 
20910  /* "View.MemoryView":1304
20911  * if slices_overlap(&src, &dst, ndim, itemsize):
20912  *
20913  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20914  * order = get_best_order(&dst, ndim)
20915  *
20916  */
20917  }
20918 
20919  /* "View.MemoryView":1307
20920  * order = get_best_order(&dst, ndim)
20921  *
20922  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
20923  * src = tmp
20924  *
20925  */
20926  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
20927  __pyx_v_tmpdata = __pyx_t_7;
20928 
20929  /* "View.MemoryView":1308
20930  *
20931  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20932  * src = tmp # <<<<<<<<<<<<<<
20933  *
20934  * if not broadcasting:
20935  */
20936  __pyx_v_src = __pyx_v_tmp;
20937 
20938  /* "View.MemoryView":1302
20939  * _err_dim(ValueError, "Dimension %d is not direct", i)
20940  *
20941  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20942  *
20943  * if not slice_is_contig(src, order, ndim):
20944  */
20945  }
20946 
20947  /* "View.MemoryView":1310
20948  * src = tmp
20949  *
20950  * if not broadcasting: # <<<<<<<<<<<<<<
20951  *
20952  *
20953  */
20954  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20955  if (__pyx_t_2) {
20956 
20957  /* "View.MemoryView":1313
20958  *
20959  *
20960  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20961  * direct_copy = slice_is_contig(dst, 'C', ndim)
20962  * elif slice_is_contig(src, 'F', ndim):
20963  */
20964  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
20965  if (__pyx_t_2) {
20966 
20967  /* "View.MemoryView":1314
20968  *
20969  * if slice_is_contig(src, 'C', ndim):
20970  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
20971  * elif slice_is_contig(src, 'F', ndim):
20972  * direct_copy = slice_is_contig(dst, 'F', ndim)
20973  */
20974  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
20975 
20976  /* "View.MemoryView":1313
20977  *
20978  *
20979  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20980  * direct_copy = slice_is_contig(dst, 'C', ndim)
20981  * elif slice_is_contig(src, 'F', ndim):
20982  */
20983  goto __pyx_L12;
20984  }
20985 
20986  /* "View.MemoryView":1315
20987  * if slice_is_contig(src, 'C', ndim):
20988  * direct_copy = slice_is_contig(dst, 'C', ndim)
20989  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20990  * direct_copy = slice_is_contig(dst, 'F', ndim)
20991  *
20992  */
20993  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
20994  if (__pyx_t_2) {
20995 
20996  /* "View.MemoryView":1316
20997  * direct_copy = slice_is_contig(dst, 'C', ndim)
20998  * elif slice_is_contig(src, 'F', ndim):
20999  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
21000  *
21001  * if direct_copy:
21002  */
21003  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
21004 
21005  /* "View.MemoryView":1315
21006  * if slice_is_contig(src, 'C', ndim):
21007  * direct_copy = slice_is_contig(dst, 'C', ndim)
21008  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
21009  * direct_copy = slice_is_contig(dst, 'F', ndim)
21010  *
21011  */
21012  }
21013  __pyx_L12:;
21014 
21015  /* "View.MemoryView":1318
21016  * direct_copy = slice_is_contig(dst, 'F', ndim)
21017  *
21018  * if direct_copy: # <<<<<<<<<<<<<<
21019  *
21020  * refcount_copying(&dst, dtype_is_object, ndim, False)
21021  */
21022  __pyx_t_2 = (__pyx_v_direct_copy != 0);
21023  if (__pyx_t_2) {
21024 
21025  /* "View.MemoryView":1320
21026  * if direct_copy:
21027  *
21028  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
21029  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
21030  * refcount_copying(&dst, dtype_is_object, ndim, True)
21031  */
21032  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21033 
21034  /* "View.MemoryView":1321
21035  *
21036  * refcount_copying(&dst, dtype_is_object, ndim, False)
21037  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
21038  * refcount_copying(&dst, dtype_is_object, ndim, True)
21039  * free(tmpdata)
21040  */
21041  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
21042 
21043  /* "View.MemoryView":1322
21044  * refcount_copying(&dst, dtype_is_object, ndim, False)
21045  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
21046  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
21047  * free(tmpdata)
21048  * return 0
21049  */
21050  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21051 
21052  /* "View.MemoryView":1323
21053  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
21054  * refcount_copying(&dst, dtype_is_object, ndim, True)
21055  * free(tmpdata) # <<<<<<<<<<<<<<
21056  * return 0
21057  *
21058  */
21059  free(__pyx_v_tmpdata);
21060 
21061  /* "View.MemoryView":1324
21062  * refcount_copying(&dst, dtype_is_object, ndim, True)
21063  * free(tmpdata)
21064  * return 0 # <<<<<<<<<<<<<<
21065  *
21066  * if order == 'F' == get_best_order(&dst, ndim):
21067  */
21068  __pyx_r = 0;
21069  goto __pyx_L0;
21070 
21071  /* "View.MemoryView":1318
21072  * direct_copy = slice_is_contig(dst, 'F', ndim)
21073  *
21074  * if direct_copy: # <<<<<<<<<<<<<<
21075  *
21076  * refcount_copying(&dst, dtype_is_object, ndim, False)
21077  */
21078  }
21079 
21080  /* "View.MemoryView":1310
21081  * src = tmp
21082  *
21083  * if not broadcasting: # <<<<<<<<<<<<<<
21084  *
21085  *
21086  */
21087  }
21088 
21089  /* "View.MemoryView":1326
21090  * return 0
21091  *
21092  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
21093  *
21094  *
21095  */
21096  __pyx_t_2 = (__pyx_v_order == 'F');
21097  if (__pyx_t_2) {
21098  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
21099  }
21100  __pyx_t_8 = (__pyx_t_2 != 0);
21101  if (__pyx_t_8) {
21102 
21103  /* "View.MemoryView":1329
21104  *
21105  *
21106  * transpose_memslice(&src) # <<<<<<<<<<<<<<
21107  * transpose_memslice(&dst)
21108  *
21109  */
21110  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
21111 
21112  /* "View.MemoryView":1330
21113  *
21114  * transpose_memslice(&src)
21115  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
21116  *
21117  * refcount_copying(&dst, dtype_is_object, ndim, False)
21118  */
21119  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
21120 
21121  /* "View.MemoryView":1326
21122  * return 0
21123  *
21124  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
21125  *
21126  *
21127  */
21128  }
21129 
21130  /* "View.MemoryView":1332
21131  * transpose_memslice(&dst)
21132  *
21133  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
21134  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
21135  * refcount_copying(&dst, dtype_is_object, ndim, True)
21136  */
21137  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21138 
21139  /* "View.MemoryView":1333
21140  *
21141  * refcount_copying(&dst, dtype_is_object, ndim, False)
21142  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
21143  * refcount_copying(&dst, dtype_is_object, ndim, True)
21144  *
21145  */
21146  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
21147 
21148  /* "View.MemoryView":1334
21149  * refcount_copying(&dst, dtype_is_object, ndim, False)
21150  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
21151  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
21152  *
21153  * free(tmpdata)
21154  */
21155  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21156 
21157  /* "View.MemoryView":1336
21158  * refcount_copying(&dst, dtype_is_object, ndim, True)
21159  *
21160  * free(tmpdata) # <<<<<<<<<<<<<<
21161  * return 0
21162  *
21163  */
21164  free(__pyx_v_tmpdata);
21165 
21166  /* "View.MemoryView":1337
21167  *
21168  * free(tmpdata)
21169  * return 0 # <<<<<<<<<<<<<<
21170  *
21171  * @cname('__pyx_memoryview_broadcast_leading')
21172  */
21173  __pyx_r = 0;
21174  goto __pyx_L0;
21175 
21176  /* "View.MemoryView":1268
21177  *
21178  * @cname('__pyx_memoryview_copy_contents')
21179  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
21180  * __Pyx_memviewslice dst,
21181  * int src_ndim, int dst_ndim,
21182  */
21183 
21184  /* function exit code */
21185  __pyx_L1_error:;
21186  {
21187  #ifdef WITH_THREAD
21188  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21189  #endif
21190  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
21191  #ifdef WITH_THREAD
21192  __Pyx_PyGILState_Release(__pyx_gilstate_save);
21193  #endif
21194  }
21195  __pyx_r = -1;
21196  __pyx_L0:;
21197  return __pyx_r;
21198 }
21199 
21200 /* "View.MemoryView":1340
21201  *
21202  * @cname('__pyx_memoryview_broadcast_leading')
21203  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
21204  * int ndim,
21205  * int ndim_other) nogil:
21206  */
21207 
21208 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
21209  int __pyx_v_i;
21210  int __pyx_v_offset;
21211  int __pyx_t_1;
21212  int __pyx_t_2;
21213  int __pyx_t_3;
21214 
21215  /* "View.MemoryView":1344
21216  * int ndim_other) nogil:
21217  * cdef int i
21218  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
21219  *
21220  * for i in range(ndim - 1, -1, -1):
21221  */
21222  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
21223 
21224  /* "View.MemoryView":1346
21225  * cdef int offset = ndim_other - ndim
21226  *
21227  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
21228  * mslice.shape[i + offset] = mslice.shape[i]
21229  * mslice.strides[i + offset] = mslice.strides[i]
21230  */
21231  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
21232  __pyx_v_i = __pyx_t_1;
21233 
21234  /* "View.MemoryView":1347
21235  *
21236  * for i in range(ndim - 1, -1, -1):
21237  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
21238  * mslice.strides[i + offset] = mslice.strides[i]
21239  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
21240  */
21241  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
21242 
21243  /* "View.MemoryView":1348
21244  * for i in range(ndim - 1, -1, -1):
21245  * mslice.shape[i + offset] = mslice.shape[i]
21246  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
21247  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
21248  *
21249  */
21250  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
21251 
21252  /* "View.MemoryView":1349
21253  * mslice.shape[i + offset] = mslice.shape[i]
21254  * mslice.strides[i + offset] = mslice.strides[i]
21255  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
21256  *
21257  * for i in range(offset):
21258  */
21259  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
21260  }
21261 
21262  /* "View.MemoryView":1351
21263  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
21264  *
21265  * for i in range(offset): # <<<<<<<<<<<<<<
21266  * mslice.shape[i] = 1
21267  * mslice.strides[i] = mslice.strides[0]
21268  */
21269  __pyx_t_1 = __pyx_v_offset;
21270  __pyx_t_2 = __pyx_t_1;
21271  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21272  __pyx_v_i = __pyx_t_3;
21273 
21274  /* "View.MemoryView":1352
21275  *
21276  * for i in range(offset):
21277  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
21278  * mslice.strides[i] = mslice.strides[0]
21279  * mslice.suboffsets[i] = -1
21280  */
21281  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
21282 
21283  /* "View.MemoryView":1353
21284  * for i in range(offset):
21285  * mslice.shape[i] = 1
21286  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
21287  * mslice.suboffsets[i] = -1
21288  *
21289  */
21290  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
21291 
21292  /* "View.MemoryView":1354
21293  * mslice.shape[i] = 1
21294  * mslice.strides[i] = mslice.strides[0]
21295  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
21296  *
21297  *
21298  */
21299  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
21300  }
21301 
21302  /* "View.MemoryView":1340
21303  *
21304  * @cname('__pyx_memoryview_broadcast_leading')
21305  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
21306  * int ndim,
21307  * int ndim_other) nogil:
21308  */
21309 
21310  /* function exit code */
21311 }
21312 
21313 /* "View.MemoryView":1362
21314  *
21315  * @cname('__pyx_memoryview_refcount_copying')
21316  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
21317  * int ndim, bint inc) nogil:
21318  *
21319  */
21320 
21321 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
21322  int __pyx_t_1;
21323 
21324  /* "View.MemoryView":1366
21325  *
21326  *
21327  * if dtype_is_object: # <<<<<<<<<<<<<<
21328  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
21329  * dst.strides, ndim, inc)
21330  */
21331  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
21332  if (__pyx_t_1) {
21333 
21334  /* "View.MemoryView":1367
21335  *
21336  * if dtype_is_object:
21337  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
21338  * dst.strides, ndim, inc)
21339  *
21340  */
21341  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
21342 
21343  /* "View.MemoryView":1366
21344  *
21345  *
21346  * if dtype_is_object: # <<<<<<<<<<<<<<
21347  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
21348  * dst.strides, ndim, inc)
21349  */
21350  }
21351 
21352  /* "View.MemoryView":1362
21353  *
21354  * @cname('__pyx_memoryview_refcount_copying')
21355  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
21356  * int ndim, bint inc) nogil:
21357  *
21358  */
21359 
21360  /* function exit code */
21361 }
21362 
21363 /* "View.MemoryView":1371
21364  *
21365  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
21366  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21367  * Py_ssize_t *strides, int ndim,
21368  * bint inc) with gil:
21369  */
21370 
21371 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
21372  __Pyx_RefNannyDeclarations
21373  #ifdef WITH_THREAD
21374  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21375  #endif
21376  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
21377 
21378  /* "View.MemoryView":1374
21379  * Py_ssize_t *strides, int ndim,
21380  * bint inc) with gil:
21381  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
21382  *
21383  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21384  */
21385  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
21386 
21387  /* "View.MemoryView":1371
21388  *
21389  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
21390  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21391  * Py_ssize_t *strides, int ndim,
21392  * bint inc) with gil:
21393  */
21394 
21395  /* function exit code */
21396  __Pyx_RefNannyFinishContext();
21397  #ifdef WITH_THREAD
21398  __Pyx_PyGILState_Release(__pyx_gilstate_save);
21399  #endif
21400 }
21401 
21402 /* "View.MemoryView":1377
21403  *
21404  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21405  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21406  * Py_ssize_t *strides, int ndim, bint inc):
21407  * cdef Py_ssize_t i
21408  */
21409 
21410 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
21411  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21412  __Pyx_RefNannyDeclarations
21413  Py_ssize_t __pyx_t_1;
21414  Py_ssize_t __pyx_t_2;
21415  Py_ssize_t __pyx_t_3;
21416  int __pyx_t_4;
21417  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
21418 
21419  /* "View.MemoryView":1381
21420  * cdef Py_ssize_t i
21421  *
21422  * for i in range(shape[0]): # <<<<<<<<<<<<<<
21423  * if ndim == 1:
21424  * if inc:
21425  */
21426  __pyx_t_1 = (__pyx_v_shape[0]);
21427  __pyx_t_2 = __pyx_t_1;
21428  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21429  __pyx_v_i = __pyx_t_3;
21430 
21431  /* "View.MemoryView":1382
21432  *
21433  * for i in range(shape[0]):
21434  * if ndim == 1: # <<<<<<<<<<<<<<
21435  * if inc:
21436  * Py_INCREF((<PyObject **> data)[0])
21437  */
21438  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
21439  if (__pyx_t_4) {
21440 
21441  /* "View.MemoryView":1383
21442  * for i in range(shape[0]):
21443  * if ndim == 1:
21444  * if inc: # <<<<<<<<<<<<<<
21445  * Py_INCREF((<PyObject **> data)[0])
21446  * else:
21447  */
21448  __pyx_t_4 = (__pyx_v_inc != 0);
21449  if (__pyx_t_4) {
21450 
21451  /* "View.MemoryView":1384
21452  * if ndim == 1:
21453  * if inc:
21454  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
21455  * else:
21456  * Py_DECREF((<PyObject **> data)[0])
21457  */
21458  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
21459 
21460  /* "View.MemoryView":1383
21461  * for i in range(shape[0]):
21462  * if ndim == 1:
21463  * if inc: # <<<<<<<<<<<<<<
21464  * Py_INCREF((<PyObject **> data)[0])
21465  * else:
21466  */
21467  goto __pyx_L6;
21468  }
21469 
21470  /* "View.MemoryView":1386
21471  * Py_INCREF((<PyObject **> data)[0])
21472  * else:
21473  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
21474  * else:
21475  * refcount_objects_in_slice(data, shape + 1, strides + 1,
21476  */
21477  /*else*/ {
21478  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
21479  }
21480  __pyx_L6:;
21481 
21482  /* "View.MemoryView":1382
21483  *
21484  * for i in range(shape[0]):
21485  * if ndim == 1: # <<<<<<<<<<<<<<
21486  * if inc:
21487  * Py_INCREF((<PyObject **> data)[0])
21488  */
21489  goto __pyx_L5;
21490  }
21491 
21492  /* "View.MemoryView":1388
21493  * Py_DECREF((<PyObject **> data)[0])
21494  * else:
21495  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
21496  * ndim - 1, inc)
21497  *
21498  */
21499  /*else*/ {
21500 
21501  /* "View.MemoryView":1389
21502  * else:
21503  * refcount_objects_in_slice(data, shape + 1, strides + 1,
21504  * ndim - 1, inc) # <<<<<<<<<<<<<<
21505  *
21506  * data += strides[0]
21507  */
21508  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
21509  }
21510  __pyx_L5:;
21511 
21512  /* "View.MemoryView":1391
21513  * ndim - 1, inc)
21514  *
21515  * data += strides[0] # <<<<<<<<<<<<<<
21516  *
21517  *
21518  */
21519  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
21520  }
21521 
21522  /* "View.MemoryView":1377
21523  *
21524  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21525  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21526  * Py_ssize_t *strides, int ndim, bint inc):
21527  * cdef Py_ssize_t i
21528  */
21529 
21530  /* function exit code */
21531  __Pyx_RefNannyFinishContext();
21532 }
21533 
21534 /* "View.MemoryView":1397
21535  *
21536  * @cname('__pyx_memoryview_slice_assign_scalar')
21537  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
21538  * size_t itemsize, void *item,
21539  * bint dtype_is_object) nogil:
21540  */
21541 
21542 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
21543 
21544  /* "View.MemoryView":1400
21545  * size_t itemsize, void *item,
21546  * bint dtype_is_object) nogil:
21547  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
21548  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
21549  * itemsize, item)
21550  */
21551  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21552 
21553  /* "View.MemoryView":1401
21554  * bint dtype_is_object) nogil:
21555  * refcount_copying(dst, dtype_is_object, ndim, False)
21556  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
21557  * itemsize, item)
21558  * refcount_copying(dst, dtype_is_object, ndim, True)
21559  */
21560  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
21561 
21562  /* "View.MemoryView":1403
21563  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
21564  * itemsize, item)
21565  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
21566  *
21567  *
21568  */
21569  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21570 
21571  /* "View.MemoryView":1397
21572  *
21573  * @cname('__pyx_memoryview_slice_assign_scalar')
21574  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
21575  * size_t itemsize, void *item,
21576  * bint dtype_is_object) nogil:
21577  */
21578 
21579  /* function exit code */
21580 }
21581 
21582 /* "View.MemoryView":1407
21583  *
21584  * @cname('__pyx_memoryview__slice_assign_scalar')
21585  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21586  * Py_ssize_t *strides, int ndim,
21587  * size_t itemsize, void *item) nogil:
21588  */
21589 
21590 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
21591  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21592  Py_ssize_t __pyx_v_stride;
21593  Py_ssize_t __pyx_v_extent;
21594  int __pyx_t_1;
21595  Py_ssize_t __pyx_t_2;
21596  Py_ssize_t __pyx_t_3;
21597  Py_ssize_t __pyx_t_4;
21598 
21599  /* "View.MemoryView":1411
21600  * size_t itemsize, void *item) nogil:
21601  * cdef Py_ssize_t i
21602  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
21603  * cdef Py_ssize_t extent = shape[0]
21604  *
21605  */
21606  __pyx_v_stride = (__pyx_v_strides[0]);
21607 
21608  /* "View.MemoryView":1412
21609  * cdef Py_ssize_t i
21610  * cdef Py_ssize_t stride = strides[0]
21611  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
21612  *
21613  * if ndim == 1:
21614  */
21615  __pyx_v_extent = (__pyx_v_shape[0]);
21616 
21617  /* "View.MemoryView":1414
21618  * cdef Py_ssize_t extent = shape[0]
21619  *
21620  * if ndim == 1: # <<<<<<<<<<<<<<
21621  * for i in range(extent):
21622  * memcpy(data, item, itemsize)
21623  */
21624  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
21625  if (__pyx_t_1) {
21626 
21627  /* "View.MemoryView":1415
21628  *
21629  * if ndim == 1:
21630  * for i in range(extent): # <<<<<<<<<<<<<<
21631  * memcpy(data, item, itemsize)
21632  * data += stride
21633  */
21634  __pyx_t_2 = __pyx_v_extent;
21635  __pyx_t_3 = __pyx_t_2;
21636  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21637  __pyx_v_i = __pyx_t_4;
21638 
21639  /* "View.MemoryView":1416
21640  * if ndim == 1:
21641  * for i in range(extent):
21642  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
21643  * data += stride
21644  * else:
21645  */
21646  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
21647 
21648  /* "View.MemoryView":1417
21649  * for i in range(extent):
21650  * memcpy(data, item, itemsize)
21651  * data += stride # <<<<<<<<<<<<<<
21652  * else:
21653  * for i in range(extent):
21654  */
21655  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21656  }
21657 
21658  /* "View.MemoryView":1414
21659  * cdef Py_ssize_t extent = shape[0]
21660  *
21661  * if ndim == 1: # <<<<<<<<<<<<<<
21662  * for i in range(extent):
21663  * memcpy(data, item, itemsize)
21664  */
21665  goto __pyx_L3;
21666  }
21667 
21668  /* "View.MemoryView":1419
21669  * data += stride
21670  * else:
21671  * for i in range(extent): # <<<<<<<<<<<<<<
21672  * _slice_assign_scalar(data, shape + 1, strides + 1,
21673  * ndim - 1, itemsize, item)
21674  */
21675  /*else*/ {
21676  __pyx_t_2 = __pyx_v_extent;
21677  __pyx_t_3 = __pyx_t_2;
21678  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21679  __pyx_v_i = __pyx_t_4;
21680 
21681  /* "View.MemoryView":1420
21682  * else:
21683  * for i in range(extent):
21684  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
21685  * ndim - 1, itemsize, item)
21686  * data += stride
21687  */
21688  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
21689 
21690  /* "View.MemoryView":1422
21691  * _slice_assign_scalar(data, shape + 1, strides + 1,
21692  * ndim - 1, itemsize, item)
21693  * data += stride # <<<<<<<<<<<<<<
21694  *
21695  *
21696  */
21697  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21698  }
21699  }
21700  __pyx_L3:;
21701 
21702  /* "View.MemoryView":1407
21703  *
21704  * @cname('__pyx_memoryview__slice_assign_scalar')
21705  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21706  * Py_ssize_t *strides, int ndim,
21707  * size_t itemsize, void *item) nogil:
21708  */
21709 
21710  /* function exit code */
21711 }
21712 
21713 /* "(tree fragment)":1
21714  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21715  * cdef object __pyx_PickleError
21716  * cdef object __pyx_result
21717  */
21718 
21719 /* Python wrapper */
21720 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
21721 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
21722 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21723  PyObject *__pyx_v___pyx_type = 0;
21724  long __pyx_v___pyx_checksum;
21725  PyObject *__pyx_v___pyx_state = 0;
21726  PyObject *__pyx_r = 0;
21727  __Pyx_RefNannyDeclarations
21728  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
21729  {
21730  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
21731  PyObject* values[3] = {0,0,0};
21732  if (unlikely(__pyx_kwds)) {
21733  Py_ssize_t kw_args;
21734  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21735  switch (pos_args) {
21736  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21737  CYTHON_FALLTHROUGH;
21738  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21739  CYTHON_FALLTHROUGH;
21740  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21741  CYTHON_FALLTHROUGH;
21742  case 0: break;
21743  default: goto __pyx_L5_argtuple_error;
21744  }
21745  kw_args = PyDict_Size(__pyx_kwds);
21746  switch (pos_args) {
21747  case 0:
21748  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
21749  else goto __pyx_L5_argtuple_error;
21750  CYTHON_FALLTHROUGH;
21751  case 1:
21752  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
21753  else {
21754  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
21755  }
21756  CYTHON_FALLTHROUGH;
21757  case 2:
21758  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
21759  else {
21760  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
21761  }
21762  }
21763  if (unlikely(kw_args > 0)) {
21764  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
21765  }
21766  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
21767  goto __pyx_L5_argtuple_error;
21768  } else {
21769  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21770  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21771  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21772  }
21773  __pyx_v___pyx_type = values[0];
21774  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
21775  __pyx_v___pyx_state = values[2];
21776  }
21777  goto __pyx_L4_argument_unpacking_done;
21778  __pyx_L5_argtuple_error:;
21779  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
21780  __pyx_L3_error:;
21781  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21782  __Pyx_RefNannyFinishContext();
21783  return NULL;
21784  __pyx_L4_argument_unpacking_done:;
21785  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
21786 
21787  /* function exit code */
21788  __Pyx_RefNannyFinishContext();
21789  return __pyx_r;
21790 }
21791 
21792 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
21793  PyObject *__pyx_v___pyx_PickleError = 0;
21794  PyObject *__pyx_v___pyx_result = 0;
21795  PyObject *__pyx_r = NULL;
21796  __Pyx_RefNannyDeclarations
21797  int __pyx_t_1;
21798  PyObject *__pyx_t_2 = NULL;
21799  PyObject *__pyx_t_3 = NULL;
21800  PyObject *__pyx_t_4 = NULL;
21801  PyObject *__pyx_t_5 = NULL;
21802  int __pyx_t_6;
21803  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
21804 
21805  /* "(tree fragment)":4
21806  * cdef object __pyx_PickleError
21807  * cdef object __pyx_result
21808  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21809  * from pickle import PickleError as __pyx_PickleError
21810  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21811  */
21812  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
21813  if (__pyx_t_1) {
21814 
21815  /* "(tree fragment)":5
21816  * cdef object __pyx_result
21817  * if __pyx_checksum != 0xb068931:
21818  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
21819  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21820  * __pyx_result = Enum.__new__(__pyx_type)
21821  */
21822  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21823  __Pyx_GOTREF(__pyx_t_2);
21824  __Pyx_INCREF(__pyx_n_s_PickleError);
21825  __Pyx_GIVEREF(__pyx_n_s_PickleError);
21826  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
21827  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21828  __Pyx_GOTREF(__pyx_t_3);
21829  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21830  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21831  __Pyx_GOTREF(__pyx_t_2);
21832  __Pyx_INCREF(__pyx_t_2);
21833  __pyx_v___pyx_PickleError = __pyx_t_2;
21834  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21835  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21836 
21837  /* "(tree fragment)":6
21838  * if __pyx_checksum != 0xb068931:
21839  * from pickle import PickleError as __pyx_PickleError
21840  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
21841  * __pyx_result = Enum.__new__(__pyx_type)
21842  * if __pyx_state is not None:
21843  */
21844  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
21845  __Pyx_GOTREF(__pyx_t_2);
21846  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
21847  __Pyx_GOTREF(__pyx_t_4);
21848  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21849  __Pyx_INCREF(__pyx_v___pyx_PickleError);
21850  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
21851  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21852  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
21853  if (likely(__pyx_t_5)) {
21854  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21855  __Pyx_INCREF(__pyx_t_5);
21856  __Pyx_INCREF(function);
21857  __Pyx_DECREF_SET(__pyx_t_2, function);
21858  }
21859  }
21860  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
21861  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21862  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21863  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
21864  __Pyx_GOTREF(__pyx_t_3);
21865  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21866  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21867  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21868  __PYX_ERR(1, 6, __pyx_L1_error)
21869 
21870  /* "(tree fragment)":4
21871  * cdef object __pyx_PickleError
21872  * cdef object __pyx_result
21873  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21874  * from pickle import PickleError as __pyx_PickleError
21875  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21876  */
21877  }
21878 
21879  /* "(tree fragment)":7
21880  * from pickle import PickleError as __pyx_PickleError
21881  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21882  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
21883  * if __pyx_state is not None:
21884  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21885  */
21886  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
21887  __Pyx_GOTREF(__pyx_t_2);
21888  __pyx_t_4 = NULL;
21889  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21890  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
21891  if (likely(__pyx_t_4)) {
21892  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21893  __Pyx_INCREF(__pyx_t_4);
21894  __Pyx_INCREF(function);
21895  __Pyx_DECREF_SET(__pyx_t_2, function);
21896  }
21897  }
21898  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
21899  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21900  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
21901  __Pyx_GOTREF(__pyx_t_3);
21902  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21903  __pyx_v___pyx_result = __pyx_t_3;
21904  __pyx_t_3 = 0;
21905 
21906  /* "(tree fragment)":8
21907  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21908  * __pyx_result = Enum.__new__(__pyx_type)
21909  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21910  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21911  * return __pyx_result
21912  */
21913  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21914  __pyx_t_6 = (__pyx_t_1 != 0);
21915  if (__pyx_t_6) {
21916 
21917  /* "(tree fragment)":9
21918  * __pyx_result = Enum.__new__(__pyx_type)
21919  * if __pyx_state is not None:
21920  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
21921  * return __pyx_result
21922  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21923  */
21924  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
21925  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
21926  __Pyx_GOTREF(__pyx_t_3);
21927  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21928 
21929  /* "(tree fragment)":8
21930  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21931  * __pyx_result = Enum.__new__(__pyx_type)
21932  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21933  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21934  * return __pyx_result
21935  */
21936  }
21937 
21938  /* "(tree fragment)":10
21939  * if __pyx_state is not None:
21940  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21941  * return __pyx_result # <<<<<<<<<<<<<<
21942  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21943  * __pyx_result.name = __pyx_state[0]
21944  */
21945  __Pyx_XDECREF(__pyx_r);
21946  __Pyx_INCREF(__pyx_v___pyx_result);
21947  __pyx_r = __pyx_v___pyx_result;
21948  goto __pyx_L0;
21949 
21950  /* "(tree fragment)":1
21951  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21952  * cdef object __pyx_PickleError
21953  * cdef object __pyx_result
21954  */
21955 
21956  /* function exit code */
21957  __pyx_L1_error:;
21958  __Pyx_XDECREF(__pyx_t_2);
21959  __Pyx_XDECREF(__pyx_t_3);
21960  __Pyx_XDECREF(__pyx_t_4);
21961  __Pyx_XDECREF(__pyx_t_5);
21962  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21963  __pyx_r = NULL;
21964  __pyx_L0:;
21965  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21966  __Pyx_XDECREF(__pyx_v___pyx_result);
21967  __Pyx_XGIVEREF(__pyx_r);
21968  __Pyx_RefNannyFinishContext();
21969  return __pyx_r;
21970 }
21971 
21972 /* "(tree fragment)":11
21973  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21974  * return __pyx_result
21975  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21976  * __pyx_result.name = __pyx_state[0]
21977  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21978  */
21979 
21980 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21981  PyObject *__pyx_r = NULL;
21982  __Pyx_RefNannyDeclarations
21983  PyObject *__pyx_t_1 = NULL;
21984  int __pyx_t_2;
21985  Py_ssize_t __pyx_t_3;
21986  int __pyx_t_4;
21987  int __pyx_t_5;
21988  PyObject *__pyx_t_6 = NULL;
21989  PyObject *__pyx_t_7 = NULL;
21990  PyObject *__pyx_t_8 = NULL;
21991  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
21992 
21993  /* "(tree fragment)":12
21994  * return __pyx_result
21995  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21996  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
21997  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21998  * __pyx_result.__dict__.update(__pyx_state[1])
21999  */
22000  if (unlikely(__pyx_v___pyx_state == Py_None)) {
22001  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
22002  __PYX_ERR(1, 12, __pyx_L1_error)
22003  }
22004  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
22005  __Pyx_GOTREF(__pyx_t_1);
22006  __Pyx_GIVEREF(__pyx_t_1);
22007  __Pyx_GOTREF(__pyx_v___pyx_result->name);
22008  __Pyx_DECREF(__pyx_v___pyx_result->name);
22009  __pyx_v___pyx_result->name = __pyx_t_1;
22010  __pyx_t_1 = 0;
22011 
22012  /* "(tree fragment)":13
22013  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
22014  * __pyx_result.name = __pyx_state[0]
22015  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
22016  * __pyx_result.__dict__.update(__pyx_state[1])
22017  */
22018  if (unlikely(__pyx_v___pyx_state == Py_None)) {
22019  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
22020  __PYX_ERR(1, 13, __pyx_L1_error)
22021  }
22022  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
22023  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
22024  if (__pyx_t_4) {
22025  } else {
22026  __pyx_t_2 = __pyx_t_4;
22027  goto __pyx_L4_bool_binop_done;
22028  }
22029  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
22030  __pyx_t_5 = (__pyx_t_4 != 0);
22031  __pyx_t_2 = __pyx_t_5;
22032  __pyx_L4_bool_binop_done:;
22033  if (__pyx_t_2) {
22034 
22035  /* "(tree fragment)":14
22036  * __pyx_result.name = __pyx_state[0]
22037  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
22038  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
22039  */
22040  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
22041  __Pyx_GOTREF(__pyx_t_6);
22042  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
22043  __Pyx_GOTREF(__pyx_t_7);
22044  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22045  if (unlikely(__pyx_v___pyx_state == Py_None)) {
22046  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
22047  __PYX_ERR(1, 14, __pyx_L1_error)
22048  }
22049  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
22050  __Pyx_GOTREF(__pyx_t_6);
22051  __pyx_t_8 = NULL;
22052  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
22053  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
22054  if (likely(__pyx_t_8)) {
22055  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
22056  __Pyx_INCREF(__pyx_t_8);
22057  __Pyx_INCREF(function);
22058  __Pyx_DECREF_SET(__pyx_t_7, function);
22059  }
22060  }
22061  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
22062  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22063  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22064  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
22065  __Pyx_GOTREF(__pyx_t_1);
22066  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22067  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22068 
22069  /* "(tree fragment)":13
22070  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
22071  * __pyx_result.name = __pyx_state[0]
22072  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
22073  * __pyx_result.__dict__.update(__pyx_state[1])
22074  */
22075  }
22076 
22077  /* "(tree fragment)":11
22078  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
22079  * return __pyx_result
22080  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
22081  * __pyx_result.name = __pyx_state[0]
22082  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
22083  */
22084 
22085  /* function exit code */
22086  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22087  goto __pyx_L0;
22088  __pyx_L1_error:;
22089  __Pyx_XDECREF(__pyx_t_1);
22090  __Pyx_XDECREF(__pyx_t_6);
22091  __Pyx_XDECREF(__pyx_t_7);
22092  __Pyx_XDECREF(__pyx_t_8);
22093  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
22094  __pyx_r = 0;
22095  __pyx_L0:;
22096  __Pyx_XGIVEREF(__pyx_r);
22097  __Pyx_RefNannyFinishContext();
22098  return __pyx_r;
22099 }
22100 
22101 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
22102  PyObject *o;
22103  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22104  o = (*t->tp_alloc)(t, 0);
22105  } else {
22106  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22107  }
22108  if (unlikely(!o)) return 0;
22109  if (unlikely(__pyx_pw_10csmoothers_10cASMFactor_1__cinit__(o, a, k) < 0)) goto bad;
22110  return o;
22111  bad:
22112  Py_DECREF(o); o = 0;
22113  return NULL;
22114 }
22115 
22116 static void __pyx_tp_dealloc_10csmoothers_cASMFactor(PyObject *o) {
22117  #if CYTHON_USE_TP_FINALIZE
22118  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22119  if (PyObject_CallFinalizerFromDealloc(o)) return;
22120  }
22121  #endif
22122  {
22123  PyObject *etype, *eval, *etb;
22124  PyErr_Fetch(&etype, &eval, &etb);
22125  ++Py_REFCNT(o);
22126  __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(o);
22127  --Py_REFCNT(o);
22128  PyErr_Restore(etype, eval, etb);
22129  }
22130  (*Py_TYPE(o)->tp_free)(o);
22131 }
22132 
22133 static PyMethodDef __pyx_methods_10csmoothers_cASMFactor[] = {
22134  {"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__, METH_NOARGS, 0},
22135  {"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__, METH_O, 0},
22136  {0, 0, 0, 0}
22137 };
22138 
22139 static PyTypeObject __pyx_type_10csmoothers_cASMFactor = {
22140  PyVarObject_HEAD_INIT(0, 0)
22141  "csmoothers.cASMFactor", /*tp_name*/
22142  sizeof(struct __pyx_obj_10csmoothers_cASMFactor), /*tp_basicsize*/
22143  0, /*tp_itemsize*/
22144  __pyx_tp_dealloc_10csmoothers_cASMFactor, /*tp_dealloc*/
22145  #if PY_VERSION_HEX < 0x030800b4
22146  0, /*tp_print*/
22147  #endif
22148  #if PY_VERSION_HEX >= 0x030800b4
22149  0, /*tp_vectorcall_offset*/
22150  #endif
22151  0, /*tp_getattr*/
22152  0, /*tp_setattr*/
22153  #if PY_MAJOR_VERSION < 3
22154  0, /*tp_compare*/
22155  #endif
22156  #if PY_MAJOR_VERSION >= 3
22157  0, /*tp_as_async*/
22158  #endif
22159  0, /*tp_repr*/
22160  0, /*tp_as_number*/
22161  0, /*tp_as_sequence*/
22162  0, /*tp_as_mapping*/
22163  0, /*tp_hash*/
22164  0, /*tp_call*/
22165  0, /*tp_str*/
22166  0, /*tp_getattro*/
22167  0, /*tp_setattro*/
22168  0, /*tp_as_buffer*/
22169  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
22170  0, /*tp_doc*/
22171  0, /*tp_traverse*/
22172  0, /*tp_clear*/
22173  0, /*tp_richcompare*/
22174  0, /*tp_weaklistoffset*/
22175  0, /*tp_iter*/
22176  0, /*tp_iternext*/
22177  __pyx_methods_10csmoothers_cASMFactor, /*tp_methods*/
22178  0, /*tp_members*/
22179  0, /*tp_getset*/
22180  0, /*tp_base*/
22181  0, /*tp_dict*/
22182  0, /*tp_descr_get*/
22183  0, /*tp_descr_set*/
22184  0, /*tp_dictoffset*/
22185  0, /*tp_init*/
22186  0, /*tp_alloc*/
22187  __pyx_tp_new_10csmoothers_cASMFactor, /*tp_new*/
22188  0, /*tp_free*/
22189  0, /*tp_is_gc*/
22190  0, /*tp_bases*/
22191  0, /*tp_mro*/
22192  0, /*tp_cache*/
22193  0, /*tp_subclasses*/
22194  0, /*tp_weaklist*/
22195  0, /*tp_del*/
22196  0, /*tp_version_tag*/
22197  #if PY_VERSION_HEX >= 0x030400a1
22198  0, /*tp_finalize*/
22199  #endif
22200  #if PY_VERSION_HEX >= 0x030800b1
22201  0, /*tp_vectorcall*/
22202  #endif
22203  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22204  0, /*tp_print*/
22205  #endif
22206 };
22207 
22208 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
22209  PyObject *o;
22210  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22211  o = (*t->tp_alloc)(t, 0);
22212  } else {
22213  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22214  }
22215  if (unlikely(!o)) return 0;
22216  if (unlikely(__pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(o, a, k) < 0)) goto bad;
22217  return o;
22218  bad:
22219  Py_DECREF(o); o = 0;
22220  return NULL;
22221 }
22222 
22223 static void __pyx_tp_dealloc_10csmoothers_cBASMFactor(PyObject *o) {
22224  #if CYTHON_USE_TP_FINALIZE
22225  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22226  if (PyObject_CallFinalizerFromDealloc(o)) return;
22227  }
22228  #endif
22229  {
22230  PyObject *etype, *eval, *etb;
22231  PyErr_Fetch(&etype, &eval, &etb);
22232  ++Py_REFCNT(o);
22233  __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(o);
22234  --Py_REFCNT(o);
22235  PyErr_Restore(etype, eval, etb);
22236  }
22237  (*Py_TYPE(o)->tp_free)(o);
22238 }
22239 
22240 static PyMethodDef __pyx_methods_10csmoothers_cBASMFactor[] = {
22241  {"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__, METH_NOARGS, 0},
22242  {"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__, METH_O, 0},
22243  {0, 0, 0, 0}
22244 };
22245 
22246 static PyTypeObject __pyx_type_10csmoothers_cBASMFactor = {
22247  PyVarObject_HEAD_INIT(0, 0)
22248  "csmoothers.cBASMFactor", /*tp_name*/
22249  sizeof(struct __pyx_obj_10csmoothers_cBASMFactor), /*tp_basicsize*/
22250  0, /*tp_itemsize*/
22251  __pyx_tp_dealloc_10csmoothers_cBASMFactor, /*tp_dealloc*/
22252  #if PY_VERSION_HEX < 0x030800b4
22253  0, /*tp_print*/
22254  #endif
22255  #if PY_VERSION_HEX >= 0x030800b4
22256  0, /*tp_vectorcall_offset*/
22257  #endif
22258  0, /*tp_getattr*/
22259  0, /*tp_setattr*/
22260  #if PY_MAJOR_VERSION < 3
22261  0, /*tp_compare*/
22262  #endif
22263  #if PY_MAJOR_VERSION >= 3
22264  0, /*tp_as_async*/
22265  #endif
22266  0, /*tp_repr*/
22267  0, /*tp_as_number*/
22268  0, /*tp_as_sequence*/
22269  0, /*tp_as_mapping*/
22270  0, /*tp_hash*/
22271  0, /*tp_call*/
22272  0, /*tp_str*/
22273  0, /*tp_getattro*/
22274  0, /*tp_setattro*/
22275  0, /*tp_as_buffer*/
22276  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
22277  0, /*tp_doc*/
22278  0, /*tp_traverse*/
22279  0, /*tp_clear*/
22280  0, /*tp_richcompare*/
22281  0, /*tp_weaklistoffset*/
22282  0, /*tp_iter*/
22283  0, /*tp_iternext*/
22284  __pyx_methods_10csmoothers_cBASMFactor, /*tp_methods*/
22285  0, /*tp_members*/
22286  0, /*tp_getset*/
22287  0, /*tp_base*/
22288  0, /*tp_dict*/
22289  0, /*tp_descr_get*/
22290  0, /*tp_descr_set*/
22291  0, /*tp_dictoffset*/
22292  0, /*tp_init*/
22293  0, /*tp_alloc*/
22294  __pyx_tp_new_10csmoothers_cBASMFactor, /*tp_new*/
22295  0, /*tp_free*/
22296  0, /*tp_is_gc*/
22297  0, /*tp_bases*/
22298  0, /*tp_mro*/
22299  0, /*tp_cache*/
22300  0, /*tp_subclasses*/
22301  0, /*tp_weaklist*/
22302  0, /*tp_del*/
22303  0, /*tp_version_tag*/
22304  #if PY_VERSION_HEX >= 0x030400a1
22305  0, /*tp_finalize*/
22306  #endif
22307  #if PY_VERSION_HEX >= 0x030800b1
22308  0, /*tp_vectorcall*/
22309  #endif
22310  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22311  0, /*tp_print*/
22312  #endif
22313 };
22314 static struct __pyx_vtabstruct_array __pyx_vtable_array;
22315 
22316 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
22317  struct __pyx_array_obj *p;
22318  PyObject *o;
22319  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22320  o = (*t->tp_alloc)(t, 0);
22321  } else {
22322  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22323  }
22324  if (unlikely(!o)) return 0;
22325  p = ((struct __pyx_array_obj *)o);
22326  p->__pyx_vtab = __pyx_vtabptr_array;
22327  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
22328  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
22329  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
22330  return o;
22331  bad:
22332  Py_DECREF(o); o = 0;
22333  return NULL;
22334 }
22335 
22336 static void __pyx_tp_dealloc_array(PyObject *o) {
22337  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
22338  #if CYTHON_USE_TP_FINALIZE
22339  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22340  if (PyObject_CallFinalizerFromDealloc(o)) return;
22341  }
22342  #endif
22343  {
22344  PyObject *etype, *eval, *etb;
22345  PyErr_Fetch(&etype, &eval, &etb);
22346  ++Py_REFCNT(o);
22347  __pyx_array___dealloc__(o);
22348  --Py_REFCNT(o);
22349  PyErr_Restore(etype, eval, etb);
22350  }
22351  Py_CLEAR(p->mode);
22352  Py_CLEAR(p->_format);
22353  (*Py_TYPE(o)->tp_free)(o);
22354 }
22355 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
22356  PyObject *r;
22357  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22358  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22359  Py_DECREF(x);
22360  return r;
22361 }
22362 
22363 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
22364  if (v) {
22365  return __pyx_array___setitem__(o, i, v);
22366  }
22367  else {
22368  PyErr_Format(PyExc_NotImplementedError,
22369  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22370  return -1;
22371  }
22372 }
22373 
22374 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
22375  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
22376  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
22377  PyErr_Clear();
22378  v = __pyx_array___getattr__(o, n);
22379  }
22380  return v;
22381 }
22382 
22383 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
22384  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
22385 }
22386 
22387 static PyMethodDef __pyx_methods_array[] = {
22388  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
22389  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
22390  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
22391  {0, 0, 0, 0}
22392 };
22393 
22394 static struct PyGetSetDef __pyx_getsets_array[] = {
22395  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
22396  {0, 0, 0, 0, 0}
22397 };
22398 
22399 static PySequenceMethods __pyx_tp_as_sequence_array = {
22400  __pyx_array___len__, /*sq_length*/
22401  0, /*sq_concat*/
22402  0, /*sq_repeat*/
22403  __pyx_sq_item_array, /*sq_item*/
22404  0, /*sq_slice*/
22405  0, /*sq_ass_item*/
22406  0, /*sq_ass_slice*/
22407  0, /*sq_contains*/
22408  0, /*sq_inplace_concat*/
22409  0, /*sq_inplace_repeat*/
22410 };
22411 
22412 static PyMappingMethods __pyx_tp_as_mapping_array = {
22413  __pyx_array___len__, /*mp_length*/
22414  __pyx_array___getitem__, /*mp_subscript*/
22415  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
22416 };
22417 
22418 static PyBufferProcs __pyx_tp_as_buffer_array = {
22419  #if PY_MAJOR_VERSION < 3
22420  0, /*bf_getreadbuffer*/
22421  #endif
22422  #if PY_MAJOR_VERSION < 3
22423  0, /*bf_getwritebuffer*/
22424  #endif
22425  #if PY_MAJOR_VERSION < 3
22426  0, /*bf_getsegcount*/
22427  #endif
22428  #if PY_MAJOR_VERSION < 3
22429  0, /*bf_getcharbuffer*/
22430  #endif
22431  __pyx_array_getbuffer, /*bf_getbuffer*/
22432  0, /*bf_releasebuffer*/
22433 };
22434 
22435 static PyTypeObject __pyx_type___pyx_array = {
22436  PyVarObject_HEAD_INIT(0, 0)
22437  "csmoothers.array", /*tp_name*/
22438  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
22439  0, /*tp_itemsize*/
22440  __pyx_tp_dealloc_array, /*tp_dealloc*/
22441  #if PY_VERSION_HEX < 0x030800b4
22442  0, /*tp_print*/
22443  #endif
22444  #if PY_VERSION_HEX >= 0x030800b4
22445  0, /*tp_vectorcall_offset*/
22446  #endif
22447  0, /*tp_getattr*/
22448  0, /*tp_setattr*/
22449  #if PY_MAJOR_VERSION < 3
22450  0, /*tp_compare*/
22451  #endif
22452  #if PY_MAJOR_VERSION >= 3
22453  0, /*tp_as_async*/
22454  #endif
22455  0, /*tp_repr*/
22456  0, /*tp_as_number*/
22457  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
22458  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
22459  0, /*tp_hash*/
22460  0, /*tp_call*/
22461  0, /*tp_str*/
22462  __pyx_tp_getattro_array, /*tp_getattro*/
22463  0, /*tp_setattro*/
22464  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
22465  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
22466  0, /*tp_doc*/
22467  0, /*tp_traverse*/
22468  0, /*tp_clear*/
22469  0, /*tp_richcompare*/
22470  0, /*tp_weaklistoffset*/
22471  0, /*tp_iter*/
22472  0, /*tp_iternext*/
22473  __pyx_methods_array, /*tp_methods*/
22474  0, /*tp_members*/
22475  __pyx_getsets_array, /*tp_getset*/
22476  0, /*tp_base*/
22477  0, /*tp_dict*/
22478  0, /*tp_descr_get*/
22479  0, /*tp_descr_set*/
22480  0, /*tp_dictoffset*/
22481  0, /*tp_init*/
22482  0, /*tp_alloc*/
22483  __pyx_tp_new_array, /*tp_new*/
22484  0, /*tp_free*/
22485  0, /*tp_is_gc*/
22486  0, /*tp_bases*/
22487  0, /*tp_mro*/
22488  0, /*tp_cache*/
22489  0, /*tp_subclasses*/
22490  0, /*tp_weaklist*/
22491  0, /*tp_del*/
22492  0, /*tp_version_tag*/
22493  #if PY_VERSION_HEX >= 0x030400a1
22494  0, /*tp_finalize*/
22495  #endif
22496  #if PY_VERSION_HEX >= 0x030800b1
22497  0, /*tp_vectorcall*/
22498  #endif
22499  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22500  0, /*tp_print*/
22501  #endif
22502 };
22503 
22504 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22505  struct __pyx_MemviewEnum_obj *p;
22506  PyObject *o;
22507  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22508  o = (*t->tp_alloc)(t, 0);
22509  } else {
22510  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22511  }
22512  if (unlikely(!o)) return 0;
22513  p = ((struct __pyx_MemviewEnum_obj *)o);
22514  p->name = Py_None; Py_INCREF(Py_None);
22515  return o;
22516 }
22517 
22518 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22519  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22520  #if CYTHON_USE_TP_FINALIZE
22521  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22522  if (PyObject_CallFinalizerFromDealloc(o)) return;
22523  }
22524  #endif
22525  PyObject_GC_UnTrack(o);
22526  Py_CLEAR(p->name);
22527  (*Py_TYPE(o)->tp_free)(o);
22528 }
22529 
22530 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
22531  int e;
22532  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22533  if (p->name) {
22534  e = (*v)(p->name, a); if (e) return e;
22535  }
22536  return 0;
22537 }
22538 
22539 static int __pyx_tp_clear_Enum(PyObject *o) {
22540  PyObject* tmp;
22541  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22542  tmp = ((PyObject*)p->name);
22543  p->name = Py_None; Py_INCREF(Py_None);
22544  Py_XDECREF(tmp);
22545  return 0;
22546 }
22547 
22548 static PyMethodDef __pyx_methods_Enum[] = {
22549  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22550  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22551  {0, 0, 0, 0}
22552 };
22553 
22554 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22555  PyVarObject_HEAD_INIT(0, 0)
22556  "csmoothers.Enum", /*tp_name*/
22557  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
22558  0, /*tp_itemsize*/
22559  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
22560  #if PY_VERSION_HEX < 0x030800b4
22561  0, /*tp_print*/
22562  #endif
22563  #if PY_VERSION_HEX >= 0x030800b4
22564  0, /*tp_vectorcall_offset*/
22565  #endif
22566  0, /*tp_getattr*/
22567  0, /*tp_setattr*/
22568  #if PY_MAJOR_VERSION < 3
22569  0, /*tp_compare*/
22570  #endif
22571  #if PY_MAJOR_VERSION >= 3
22572  0, /*tp_as_async*/
22573  #endif
22574  __pyx_MemviewEnum___repr__, /*tp_repr*/
22575  0, /*tp_as_number*/
22576  0, /*tp_as_sequence*/
22577  0, /*tp_as_mapping*/
22578  0, /*tp_hash*/
22579  0, /*tp_call*/
22580  0, /*tp_str*/
22581  0, /*tp_getattro*/
22582  0, /*tp_setattro*/
22583  0, /*tp_as_buffer*/
22584  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22585  0, /*tp_doc*/
22586  __pyx_tp_traverse_Enum, /*tp_traverse*/
22587  __pyx_tp_clear_Enum, /*tp_clear*/
22588  0, /*tp_richcompare*/
22589  0, /*tp_weaklistoffset*/
22590  0, /*tp_iter*/
22591  0, /*tp_iternext*/
22592  __pyx_methods_Enum, /*tp_methods*/
22593  0, /*tp_members*/
22594  0, /*tp_getset*/
22595  0, /*tp_base*/
22596  0, /*tp_dict*/
22597  0, /*tp_descr_get*/
22598  0, /*tp_descr_set*/
22599  0, /*tp_dictoffset*/
22600  __pyx_MemviewEnum___init__, /*tp_init*/
22601  0, /*tp_alloc*/
22602  __pyx_tp_new_Enum, /*tp_new*/
22603  0, /*tp_free*/
22604  0, /*tp_is_gc*/
22605  0, /*tp_bases*/
22606  0, /*tp_mro*/
22607  0, /*tp_cache*/
22608  0, /*tp_subclasses*/
22609  0, /*tp_weaklist*/
22610  0, /*tp_del*/
22611  0, /*tp_version_tag*/
22612  #if PY_VERSION_HEX >= 0x030400a1
22613  0, /*tp_finalize*/
22614  #endif
22615  #if PY_VERSION_HEX >= 0x030800b1
22616  0, /*tp_vectorcall*/
22617  #endif
22618  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22619  0, /*tp_print*/
22620  #endif
22621 };
22622 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22623 
22624 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22625  struct __pyx_memoryview_obj *p;
22626  PyObject *o;
22627  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22628  o = (*t->tp_alloc)(t, 0);
22629  } else {
22630  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22631  }
22632  if (unlikely(!o)) return 0;
22633  p = ((struct __pyx_memoryview_obj *)o);
22634  p->__pyx_vtab = __pyx_vtabptr_memoryview;
22635  p->obj = Py_None; Py_INCREF(Py_None);
22636  p->_size = Py_None; Py_INCREF(Py_None);
22637  p->_array_interface = Py_None; Py_INCREF(Py_None);
22638  p->view.obj = NULL;
22639  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
22640  return o;
22641  bad:
22642  Py_DECREF(o); o = 0;
22643  return NULL;
22644 }
22645 
22646 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22647  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22648  #if CYTHON_USE_TP_FINALIZE
22649  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22650  if (PyObject_CallFinalizerFromDealloc(o)) return;
22651  }
22652  #endif
22653  PyObject_GC_UnTrack(o);
22654  {
22655  PyObject *etype, *eval, *etb;
22656  PyErr_Fetch(&etype, &eval, &etb);
22657  ++Py_REFCNT(o);
22658  __pyx_memoryview___dealloc__(o);
22659  --Py_REFCNT(o);
22660  PyErr_Restore(etype, eval, etb);
22661  }
22662  Py_CLEAR(p->obj);
22663  Py_CLEAR(p->_size);
22664  Py_CLEAR(p->_array_interface);
22665  (*Py_TYPE(o)->tp_free)(o);
22666 }
22667 
22668 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
22669  int e;
22670  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22671  if (p->obj) {
22672  e = (*v)(p->obj, a); if (e) return e;
22673  }
22674  if (p->_size) {
22675  e = (*v)(p->_size, a); if (e) return e;
22676  }
22677  if (p->_array_interface) {
22678  e = (*v)(p->_array_interface, a); if (e) return e;
22679  }
22680  if (p->view.obj) {
22681  e = (*v)(p->view.obj, a); if (e) return e;
22682  }
22683  return 0;
22684 }
22685 
22686 static int __pyx_tp_clear_memoryview(PyObject *o) {
22687  PyObject* tmp;
22688  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22689  tmp = ((PyObject*)p->obj);
22690  p->obj = Py_None; Py_INCREF(Py_None);
22691  Py_XDECREF(tmp);
22692  tmp = ((PyObject*)p->_size);
22693  p->_size = Py_None; Py_INCREF(Py_None);
22694  Py_XDECREF(tmp);
22695  tmp = ((PyObject*)p->_array_interface);
22696  p->_array_interface = Py_None; Py_INCREF(Py_None);
22697  Py_XDECREF(tmp);
22698  Py_CLEAR(p->view.obj);
22699  return 0;
22700 }
22701 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22702  PyObject *r;
22703  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22704  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22705  Py_DECREF(x);
22706  return r;
22707 }
22708 
22709 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
22710  if (v) {
22711  return __pyx_memoryview___setitem__(o, i, v);
22712  }
22713  else {
22714  PyErr_Format(PyExc_NotImplementedError,
22715  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22716  return -1;
22717  }
22718 }
22719 
22720 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
22721  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22722 }
22723 
22724 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
22725  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22726 }
22727 
22728 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
22729  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22730 }
22731 
22732 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
22733  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22734 }
22735 
22736 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
22737  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22738 }
22739 
22740 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
22741  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22742 }
22743 
22744 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
22745  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22746 }
22747 
22748 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
22749  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22750 }
22751 
22752 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
22753  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22754 }
22755 
22756 static PyMethodDef __pyx_methods_memoryview[] = {
22757  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22758  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22759  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22760  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22761  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22762  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22763  {0, 0, 0, 0}
22764 };
22765 
22766 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22767  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
22768  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
22769  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
22770  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
22771  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
22772  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
22773  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
22774  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
22775  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
22776  {0, 0, 0, 0, 0}
22777 };
22778 
22779 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22780  __pyx_memoryview___len__, /*sq_length*/
22781  0, /*sq_concat*/
22782  0, /*sq_repeat*/
22783  __pyx_sq_item_memoryview, /*sq_item*/
22784  0, /*sq_slice*/
22785  0, /*sq_ass_item*/
22786  0, /*sq_ass_slice*/
22787  0, /*sq_contains*/
22788  0, /*sq_inplace_concat*/
22789  0, /*sq_inplace_repeat*/
22790 };
22791 
22792 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22793  __pyx_memoryview___len__, /*mp_length*/
22794  __pyx_memoryview___getitem__, /*mp_subscript*/
22795  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
22796 };
22797 
22798 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22799  #if PY_MAJOR_VERSION < 3
22800  0, /*bf_getreadbuffer*/
22801  #endif
22802  #if PY_MAJOR_VERSION < 3
22803  0, /*bf_getwritebuffer*/
22804  #endif
22805  #if PY_MAJOR_VERSION < 3
22806  0, /*bf_getsegcount*/
22807  #endif
22808  #if PY_MAJOR_VERSION < 3
22809  0, /*bf_getcharbuffer*/
22810  #endif
22811  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
22812  0, /*bf_releasebuffer*/
22813 };
22814 
22815 static PyTypeObject __pyx_type___pyx_memoryview = {
22816  PyVarObject_HEAD_INIT(0, 0)
22817  "csmoothers.memoryview", /*tp_name*/
22818  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
22819  0, /*tp_itemsize*/
22820  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
22821  #if PY_VERSION_HEX < 0x030800b4
22822  0, /*tp_print*/
22823  #endif
22824  #if PY_VERSION_HEX >= 0x030800b4
22825  0, /*tp_vectorcall_offset*/
22826  #endif
22827  0, /*tp_getattr*/
22828  0, /*tp_setattr*/
22829  #if PY_MAJOR_VERSION < 3
22830  0, /*tp_compare*/
22831  #endif
22832  #if PY_MAJOR_VERSION >= 3
22833  0, /*tp_as_async*/
22834  #endif
22835  __pyx_memoryview___repr__, /*tp_repr*/
22836  0, /*tp_as_number*/
22837  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
22838  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
22839  0, /*tp_hash*/
22840  0, /*tp_call*/
22841  __pyx_memoryview___str__, /*tp_str*/
22842  0, /*tp_getattro*/
22843  0, /*tp_setattro*/
22844  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
22845  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22846  0, /*tp_doc*/
22847  __pyx_tp_traverse_memoryview, /*tp_traverse*/
22848  __pyx_tp_clear_memoryview, /*tp_clear*/
22849  0, /*tp_richcompare*/
22850  0, /*tp_weaklistoffset*/
22851  0, /*tp_iter*/
22852  0, /*tp_iternext*/
22853  __pyx_methods_memoryview, /*tp_methods*/
22854  0, /*tp_members*/
22855  __pyx_getsets_memoryview, /*tp_getset*/
22856  0, /*tp_base*/
22857  0, /*tp_dict*/
22858  0, /*tp_descr_get*/
22859  0, /*tp_descr_set*/
22860  0, /*tp_dictoffset*/
22861  0, /*tp_init*/
22862  0, /*tp_alloc*/
22863  __pyx_tp_new_memoryview, /*tp_new*/
22864  0, /*tp_free*/
22865  0, /*tp_is_gc*/
22866  0, /*tp_bases*/
22867  0, /*tp_mro*/
22868  0, /*tp_cache*/
22869  0, /*tp_subclasses*/
22870  0, /*tp_weaklist*/
22871  0, /*tp_del*/
22872  0, /*tp_version_tag*/
22873  #if PY_VERSION_HEX >= 0x030400a1
22874  0, /*tp_finalize*/
22875  #endif
22876  #if PY_VERSION_HEX >= 0x030800b1
22877  0, /*tp_vectorcall*/
22878  #endif
22879  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22880  0, /*tp_print*/
22881  #endif
22882 };
22883 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22884 
22885 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22886  struct __pyx_memoryviewslice_obj *p;
22887  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22888  if (unlikely(!o)) return 0;
22889  p = ((struct __pyx_memoryviewslice_obj *)o);
22890  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22891  p->from_object = Py_None; Py_INCREF(Py_None);
22892  p->from_slice.memview = NULL;
22893  return o;
22894 }
22895 
22896 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22897  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22898  #if CYTHON_USE_TP_FINALIZE
22899  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22900  if (PyObject_CallFinalizerFromDealloc(o)) return;
22901  }
22902  #endif
22903  PyObject_GC_UnTrack(o);
22904  {
22905  PyObject *etype, *eval, *etb;
22906  PyErr_Fetch(&etype, &eval, &etb);
22907  ++Py_REFCNT(o);
22908  __pyx_memoryviewslice___dealloc__(o);
22909  --Py_REFCNT(o);
22910  PyErr_Restore(etype, eval, etb);
22911  }
22912  Py_CLEAR(p->from_object);
22913  PyObject_GC_Track(o);
22914  __pyx_tp_dealloc_memoryview(o);
22915 }
22916 
22917 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
22918  int e;
22919  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22920  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
22921  if (p->from_object) {
22922  e = (*v)(p->from_object, a); if (e) return e;
22923  }
22924  return 0;
22925 }
22926 
22927 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22928  PyObject* tmp;
22929  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22930  __pyx_tp_clear_memoryview(o);
22931  tmp = ((PyObject*)p->from_object);
22932  p->from_object = Py_None; Py_INCREF(Py_None);
22933  Py_XDECREF(tmp);
22934  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22935  return 0;
22936 }
22937 
22938 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
22939  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22940 }
22941 
22942 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22943  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22944  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22945  {0, 0, 0, 0}
22946 };
22947 
22948 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22949  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
22950  {0, 0, 0, 0, 0}
22951 };
22952 
22953 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22954  PyVarObject_HEAD_INIT(0, 0)
22955  "csmoothers._memoryviewslice", /*tp_name*/
22956  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
22957  0, /*tp_itemsize*/
22958  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
22959  #if PY_VERSION_HEX < 0x030800b4
22960  0, /*tp_print*/
22961  #endif
22962  #if PY_VERSION_HEX >= 0x030800b4
22963  0, /*tp_vectorcall_offset*/
22964  #endif
22965  0, /*tp_getattr*/
22966  0, /*tp_setattr*/
22967  #if PY_MAJOR_VERSION < 3
22968  0, /*tp_compare*/
22969  #endif
22970  #if PY_MAJOR_VERSION >= 3
22971  0, /*tp_as_async*/
22972  #endif
22973  #if CYTHON_COMPILING_IN_PYPY
22974  __pyx_memoryview___repr__, /*tp_repr*/
22975  #else
22976  0, /*tp_repr*/
22977  #endif
22978  0, /*tp_as_number*/
22979  0, /*tp_as_sequence*/
22980  0, /*tp_as_mapping*/
22981  0, /*tp_hash*/
22982  0, /*tp_call*/
22983  #if CYTHON_COMPILING_IN_PYPY
22984  __pyx_memoryview___str__, /*tp_str*/
22985  #else
22986  0, /*tp_str*/
22987  #endif
22988  0, /*tp_getattro*/
22989  0, /*tp_setattro*/
22990  0, /*tp_as_buffer*/
22991  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22992  "Internal class for passing memoryview slices to Python", /*tp_doc*/
22993  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
22994  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
22995  0, /*tp_richcompare*/
22996  0, /*tp_weaklistoffset*/
22997  0, /*tp_iter*/
22998  0, /*tp_iternext*/
22999  __pyx_methods__memoryviewslice, /*tp_methods*/
23000  0, /*tp_members*/
23001  __pyx_getsets__memoryviewslice, /*tp_getset*/
23002  0, /*tp_base*/
23003  0, /*tp_dict*/
23004  0, /*tp_descr_get*/
23005  0, /*tp_descr_set*/
23006  0, /*tp_dictoffset*/
23007  0, /*tp_init*/
23008  0, /*tp_alloc*/
23009  __pyx_tp_new__memoryviewslice, /*tp_new*/
23010  0, /*tp_free*/
23011  0, /*tp_is_gc*/
23012  0, /*tp_bases*/
23013  0, /*tp_mro*/
23014  0, /*tp_cache*/
23015  0, /*tp_subclasses*/
23016  0, /*tp_weaklist*/
23017  0, /*tp_del*/
23018  0, /*tp_version_tag*/
23019  #if PY_VERSION_HEX >= 0x030400a1
23020  0, /*tp_finalize*/
23021  #endif
23022  #if PY_VERSION_HEX >= 0x030800b1
23023  0, /*tp_vectorcall*/
23024  #endif
23025  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
23026  0, /*tp_print*/
23027  #endif
23028 };
23029 
23030 static PyMethodDef __pyx_methods[] = {
23031  {0, 0, 0, 0}
23032 };
23033 
23034 #if PY_MAJOR_VERSION >= 3
23035 #if CYTHON_PEP489_MULTI_PHASE_INIT
23036 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
23037 static int __pyx_pymod_exec_csmoothers(PyObject* module); /*proto*/
23038 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
23039  {Py_mod_create, (void*)__pyx_pymod_create},
23040  {Py_mod_exec, (void*)__pyx_pymod_exec_csmoothers},
23041  {0, NULL}
23042 };
23043 #endif
23044 
23045 static struct PyModuleDef __pyx_moduledef = {
23046  PyModuleDef_HEAD_INIT,
23047  "csmoothers",
23048  0, /* m_doc */
23049  #if CYTHON_PEP489_MULTI_PHASE_INIT
23050  0, /* m_size */
23051  #else
23052  -1, /* m_size */
23053  #endif
23054  __pyx_methods /* m_methods */,
23055  #if CYTHON_PEP489_MULTI_PHASE_INIT
23056  __pyx_moduledef_slots, /* m_slots */
23057  #else
23058  NULL, /* m_reload */
23059  #endif
23060  NULL, /* m_traverse */
23061  NULL, /* m_clear */
23062  NULL /* m_free */
23063 };
23064 #endif
23065 #ifndef CYTHON_SMALL_CODE
23066 #if defined(__clang__)
23067  #define CYTHON_SMALL_CODE
23068 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
23069  #define CYTHON_SMALL_CODE __attribute__((cold))
23070 #else
23071  #define CYTHON_SMALL_CODE
23072 #endif
23073 #endif
23074 
23075 static __Pyx_StringTabEntry __pyx_string_tab[] = {
23076  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
23077  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
23078  {&__pyx_n_s_ASMFactor, __pyx_k_ASMFactor, sizeof(__pyx_k_ASMFactor), 0, 0, 1, 1},
23079  {&__pyx_n_s_ASMFactor___init, __pyx_k_ASMFactor___init, sizeof(__pyx_k_ASMFactor___init), 0, 0, 1, 1},
23080  {&__pyx_n_s_BASMFactor, __pyx_k_BASMFactor, sizeof(__pyx_k_BASMFactor), 0, 0, 1, 1},
23081  {&__pyx_n_s_BASMFactor___init, __pyx_k_BASMFactor___init, sizeof(__pyx_k_BASMFactor___init), 0, 0, 1, 1},
23082  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
23083  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
23084  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
23085  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
23086  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
23087  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
23088  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
23089  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
23090  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
23091  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
23092  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
23093  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
23094  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
23095  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
23096  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
23097  {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1},
23098  {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1},
23099  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
23100  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
23101  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
23102  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
23103  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
23104  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
23105  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
23106  {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1},
23107  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
23108  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
23109  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
23110  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
23111  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
23112  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
23113  {&__pyx_n_s_asmFactor, __pyx_k_asmFactor, sizeof(__pyx_k_asmFactor), 0, 0, 1, 1},
23114  {&__pyx_n_s_asm_NR_prepare, __pyx_k_asm_NR_prepare, sizeof(__pyx_k_asm_NR_prepare), 0, 0, 1, 1},
23115  {&__pyx_n_s_asm_NR_solve, __pyx_k_asm_NR_solve, sizeof(__pyx_k_asm_NR_solve), 0, 0, 1, 1},
23116  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
23117  {&__pyx_n_s_basmFactor, __pyx_k_basmFactor, sizeof(__pyx_k_basmFactor), 0, 0, 1, 1},
23118  {&__pyx_n_s_basm_NR_prepare, __pyx_k_basm_NR_prepare, sizeof(__pyx_k_basm_NR_prepare), 0, 0, 1, 1},
23119  {&__pyx_n_s_basm_NR_solve, __pyx_k_basm_NR_solve, sizeof(__pyx_k_basm_NR_solve), 0, 0, 1, 1},
23120  {&__pyx_n_s_bs, __pyx_k_bs, sizeof(__pyx_k_bs), 0, 0, 1, 1},
23121  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
23122  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
23123  {&__pyx_n_s_cASMFactor, __pyx_k_cASMFactor, sizeof(__pyx_k_cASMFactor), 0, 0, 1, 1},
23124  {&__pyx_n_s_cASMFactor_2, __pyx_k_cASMFactor_2, sizeof(__pyx_k_cASMFactor_2), 0, 0, 1, 1},
23125  {&__pyx_n_s_cBASMFactor, __pyx_k_cBASMFactor, sizeof(__pyx_k_cBASMFactor), 0, 0, 1, 1},
23126  {&__pyx_n_s_cBASMFactor_2, __pyx_k_cBASMFactor_2, sizeof(__pyx_k_cBASMFactor_2), 0, 0, 1, 1},
23127  {&__pyx_n_s_cSparseMatrix, __pyx_k_cSparseMatrix, sizeof(__pyx_k_cSparseMatrix), 0, 0, 1, 1},
23128  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
23129  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
23130  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
23131  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
23132  {&__pyx_n_s_csmoothers, __pyx_k_csmoothers, sizeof(__pyx_k_csmoothers), 0, 0, 1, 1},
23133  {&__pyx_n_s_dX, __pyx_k_dX, sizeof(__pyx_k_dX), 0, 0, 1, 1},
23134  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
23135  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
23136  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
23137  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
23138  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
23139  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
23140  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
23141  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
23142  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
23143  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
23144  {&__pyx_n_s_gauss_seidel_NR_preare, __pyx_k_gauss_seidel_NR_preare, sizeof(__pyx_k_gauss_seidel_NR_preare), 0, 0, 1, 1},
23145  {&__pyx_n_s_gauss_seidel_NR_solve, __pyx_k_gauss_seidel_NR_solve, sizeof(__pyx_k_gauss_seidel_NR_solve), 0, 0, 1, 1},
23146  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
23147  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
23148  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
23149  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
23150  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
23151  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
23152  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
23153  {&__pyx_n_s_jacobi_NR_prepare, __pyx_k_jacobi_NR_prepare, sizeof(__pyx_k_jacobi_NR_prepare), 0, 0, 1, 1},
23154  {&__pyx_n_s_jacobi_NR_solve, __pyx_k_jacobi_NR_solve, sizeof(__pyx_k_jacobi_NR_solve), 0, 0, 1, 1},
23155  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
23156  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
23157  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
23158  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
23159  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
23160  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
23161  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
23162  {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1},
23163  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
23164  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
23165  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
23166  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
23167  {&__pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_k_nl_gauss_seidel_NR_solve, sizeof(__pyx_k_nl_gauss_seidel_NR_solve), 0, 0, 1, 1},
23168  {&__pyx_n_s_nl_jacobi_NR_solve, __pyx_k_nl_jacobi_NR_solve, sizeof(__pyx_k_nl_jacobi_NR_solve), 0, 0, 1, 1},
23169  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
23170  {&__pyx_n_s_node_order, __pyx_k_node_order, sizeof(__pyx_k_node_order), 0, 0, 1, 1},
23171  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
23172  {&__pyx_n_s_nr, __pyx_k_nr, sizeof(__pyx_k_nr), 0, 0, 1, 1},
23173  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
23174  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
23175  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
23176  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
23177  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
23178  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
23179  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
23180  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
23181  {&__pyx_kp_s_proteus_csmoothers_pyx, __pyx_k_proteus_csmoothers_pyx, sizeof(__pyx_k_proteus_csmoothers_pyx), 0, 0, 1, 0},
23182  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
23183  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
23184  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
23185  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
23186  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
23187  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
23188  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
23189  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
23190  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
23191  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
23192  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
23193  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
23194  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
23195  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
23196  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
23197  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
23198  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
23199  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
23200  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
23201  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
23202  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
23203  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
23204  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
23205  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
23206  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
23207  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
23208  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
23209  {&__pyx_n_s_tol, __pyx_k_tol, sizeof(__pyx_k_tol), 0, 0, 1, 1},
23210  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
23211  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
23212  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
23213  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
23214  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
23215  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
23216  {0, 0, 0, 0, 0, 0, 0}
23217 };
23218 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
23219  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 5, __pyx_L1_error)
23220  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
23221  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 272, __pyx_L1_error)
23222  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(2, 285, __pyx_L1_error)
23223  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 856, __pyx_L1_error)
23224  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1038, __pyx_L1_error)
23225  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
23226  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
23227  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
23228  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
23229  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
23230  return 0;
23231  __pyx_L1_error:;
23232  return -1;
23233 }
23234 
23235 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
23236  __Pyx_RefNannyDeclarations
23237  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
23238 
23239  /* "(tree fragment)":2
23240  * def __reduce_cython__(self):
23241  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23242  * def __setstate_cython__(self, __pyx_state):
23243  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23244  */
23245  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error)
23246  __Pyx_GOTREF(__pyx_tuple_);
23247  __Pyx_GIVEREF(__pyx_tuple_);
23248 
23249  /* "(tree fragment)":4
23250  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23251  * def __setstate_cython__(self, __pyx_state):
23252  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23253  */
23254  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error)
23255  __Pyx_GOTREF(__pyx_tuple__2);
23256  __Pyx_GIVEREF(__pyx_tuple__2);
23257 
23258  /* "(tree fragment)":2
23259  * def __reduce_cython__(self):
23260  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23261  * def __setstate_cython__(self, __pyx_state):
23262  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23263  */
23264  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
23265  __Pyx_GOTREF(__pyx_tuple__3);
23266  __Pyx_GIVEREF(__pyx_tuple__3);
23267 
23268  /* "(tree fragment)":4
23269  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23270  * def __setstate_cython__(self, __pyx_state):
23271  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23272  */
23273  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
23274  __Pyx_GOTREF(__pyx_tuple__4);
23275  __Pyx_GIVEREF(__pyx_tuple__4);
23276 
23277  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
23278  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
23279  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
23280  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
23281  *
23282  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
23283  */
23284  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 272, __pyx_L1_error)
23285  __Pyx_GOTREF(__pyx_tuple__5);
23286  __Pyx_GIVEREF(__pyx_tuple__5);
23287 
23288  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
23289  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
23290  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
23291  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
23292  *
23293  * info.buf = PyArray_DATA(self)
23294  */
23295  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 276, __pyx_L1_error)
23296  __Pyx_GOTREF(__pyx_tuple__6);
23297  __Pyx_GIVEREF(__pyx_tuple__6);
23298 
23299  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
23300  * if ((descr.byteorder == c'>' and little_endian) or
23301  * (descr.byteorder == c'<' and not little_endian)):
23302  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
23303  * if t == NPY_BYTE: f = "b"
23304  * elif t == NPY_UBYTE: f = "B"
23305  */
23306  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 306, __pyx_L1_error)
23307  __Pyx_GOTREF(__pyx_tuple__7);
23308  __Pyx_GIVEREF(__pyx_tuple__7);
23309 
23310  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
23311  *
23312  * if (end - f) - <int>(new_offset - offset[0]) < 15:
23313  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
23314  *
23315  * if ((child.byteorder == c'>' and little_endian) or
23316  */
23317  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 856, __pyx_L1_error)
23318  __Pyx_GOTREF(__pyx_tuple__8);
23319  __Pyx_GIVEREF(__pyx_tuple__8);
23320 
23321  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
23322  * t = child.type_num
23323  * if end - f < 5:
23324  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
23325  *
23326  * # Until ticket #99 is fixed, use integers to avoid warnings
23327  */
23328  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 880, __pyx_L1_error)
23329  __Pyx_GOTREF(__pyx_tuple__9);
23330  __Pyx_GIVEREF(__pyx_tuple__9);
23331 
23332  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
23333  * _import_array()
23334  * except Exception:
23335  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
23336  *
23337  * cdef inline int import_umath() except -1:
23338  */
23339  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 1038, __pyx_L1_error)
23340  __Pyx_GOTREF(__pyx_tuple__10);
23341  __Pyx_GIVEREF(__pyx_tuple__10);
23342 
23343  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
23344  * _import_umath()
23345  * except Exception:
23346  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
23347  *
23348  * cdef inline int import_ufunc() except -1:
23349  */
23350  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 1044, __pyx_L1_error)
23351  __Pyx_GOTREF(__pyx_tuple__11);
23352  __Pyx_GIVEREF(__pyx_tuple__11);
23353 
23354  /* "View.MemoryView":133
23355  *
23356  * if not self.ndim:
23357  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
23358  *
23359  * if itemsize <= 0:
23360  */
23361  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 133, __pyx_L1_error)
23362  __Pyx_GOTREF(__pyx_tuple__12);
23363  __Pyx_GIVEREF(__pyx_tuple__12);
23364 
23365  /* "View.MemoryView":136
23366  *
23367  * if itemsize <= 0:
23368  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
23369  *
23370  * if not isinstance(format, bytes):
23371  */
23372  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 136, __pyx_L1_error)
23373  __Pyx_GOTREF(__pyx_tuple__13);
23374  __Pyx_GIVEREF(__pyx_tuple__13);
23375 
23376  /* "View.MemoryView":148
23377  *
23378  * if not self._shape:
23379  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
23380  *
23381  *
23382  */
23383  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 148, __pyx_L1_error)
23384  __Pyx_GOTREF(__pyx_tuple__14);
23385  __Pyx_GIVEREF(__pyx_tuple__14);
23386 
23387  /* "View.MemoryView":176
23388  * self.data = <char *>malloc(self.len)
23389  * if not self.data:
23390  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
23391  *
23392  * if self.dtype_is_object:
23393  */
23394  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 176, __pyx_L1_error)
23395  __Pyx_GOTREF(__pyx_tuple__15);
23396  __Pyx_GIVEREF(__pyx_tuple__15);
23397 
23398  /* "View.MemoryView":192
23399  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
23400  * if not (flags & bufmode):
23401  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
23402  * info.buf = self.data
23403  * info.len = self.len
23404  */
23405  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 192, __pyx_L1_error)
23406  __Pyx_GOTREF(__pyx_tuple__16);
23407  __Pyx_GIVEREF(__pyx_tuple__16);
23408 
23409  /* "(tree fragment)":2
23410  * def __reduce_cython__(self):
23411  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23412  * def __setstate_cython__(self, __pyx_state):
23413  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23414  */
23415  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 2, __pyx_L1_error)
23416  __Pyx_GOTREF(__pyx_tuple__17);
23417  __Pyx_GIVEREF(__pyx_tuple__17);
23418 
23419  /* "(tree fragment)":4
23420  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23421  * def __setstate_cython__(self, __pyx_state):
23422  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23423  */
23424  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 4, __pyx_L1_error)
23425  __Pyx_GOTREF(__pyx_tuple__18);
23426  __Pyx_GIVEREF(__pyx_tuple__18);
23427 
23428  /* "View.MemoryView":418
23429  * def __setitem__(memoryview self, object index, object value):
23430  * if self.view.readonly:
23431  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
23432  *
23433  * have_slices, index = _unellipsify(index, self.view.ndim)
23434  */
23435  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 418, __pyx_L1_error)
23436  __Pyx_GOTREF(__pyx_tuple__19);
23437  __Pyx_GIVEREF(__pyx_tuple__19);
23438 
23439  /* "View.MemoryView":495
23440  * result = struct.unpack(self.view.format, bytesitem)
23441  * except struct.error:
23442  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
23443  * else:
23444  * if len(self.view.format) == 1:
23445  */
23446  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 495, __pyx_L1_error)
23447  __Pyx_GOTREF(__pyx_tuple__20);
23448  __Pyx_GIVEREF(__pyx_tuple__20);
23449 
23450  /* "View.MemoryView":520
23451  * def __getbuffer__(self, Py_buffer *info, int flags):
23452  * if flags & PyBUF_WRITABLE and self.view.readonly:
23453  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
23454  *
23455  * if flags & PyBUF_ND:
23456  */
23457  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 520, __pyx_L1_error)
23458  __Pyx_GOTREF(__pyx_tuple__21);
23459  __Pyx_GIVEREF(__pyx_tuple__21);
23460 
23461  /* "View.MemoryView":570
23462  * if self.view.strides == NULL:
23463  *
23464  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
23465  *
23466  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
23467  */
23468  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 570, __pyx_L1_error)
23469  __Pyx_GOTREF(__pyx_tuple__22);
23470  __Pyx_GIVEREF(__pyx_tuple__22);
23471 
23472  /* "View.MemoryView":577
23473  * def suboffsets(self):
23474  * if self.view.suboffsets == NULL:
23475  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
23476  *
23477  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
23478  */
23479  __pyx_tuple__23 = PyTuple_New(1); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 577, __pyx_L1_error)
23480  __Pyx_GOTREF(__pyx_tuple__23);
23481  __Pyx_INCREF(__pyx_int_neg_1);
23482  __Pyx_GIVEREF(__pyx_int_neg_1);
23483  PyTuple_SET_ITEM(__pyx_tuple__23, 0, __pyx_int_neg_1);
23484  __Pyx_GIVEREF(__pyx_tuple__23);
23485 
23486  /* "(tree fragment)":2
23487  * def __reduce_cython__(self):
23488  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23489  * def __setstate_cython__(self, __pyx_state):
23490  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23491  */
23492  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 2, __pyx_L1_error)
23493  __Pyx_GOTREF(__pyx_tuple__24);
23494  __Pyx_GIVEREF(__pyx_tuple__24);
23495 
23496  /* "(tree fragment)":4
23497  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23498  * def __setstate_cython__(self, __pyx_state):
23499  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23500  */
23501  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 4, __pyx_L1_error)
23502  __Pyx_GOTREF(__pyx_tuple__25);
23503  __Pyx_GIVEREF(__pyx_tuple__25);
23504 
23505  /* "View.MemoryView":682
23506  * if item is Ellipsis:
23507  * if not seen_ellipsis:
23508  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
23509  * seen_ellipsis = True
23510  * else:
23511  */
23512  __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) __PYX_ERR(1, 682, __pyx_L1_error)
23513  __Pyx_GOTREF(__pyx_slice__26);
23514  __Pyx_GIVEREF(__pyx_slice__26);
23515 
23516  /* "View.MemoryView":703
23517  * for suboffset in suboffsets[:ndim]:
23518  * if suboffset >= 0:
23519  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
23520  *
23521  *
23522  */
23523  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 703, __pyx_L1_error)
23524  __Pyx_GOTREF(__pyx_tuple__27);
23525  __Pyx_GIVEREF(__pyx_tuple__27);
23526 
23527  /* "(tree fragment)":2
23528  * def __reduce_cython__(self):
23529  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23530  * def __setstate_cython__(self, __pyx_state):
23531  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23532  */
23533  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 2, __pyx_L1_error)
23534  __Pyx_GOTREF(__pyx_tuple__28);
23535  __Pyx_GIVEREF(__pyx_tuple__28);
23536 
23537  /* "(tree fragment)":4
23538  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23539  * def __setstate_cython__(self, __pyx_state):
23540  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23541  */
23542  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 4, __pyx_L1_error)
23543  __Pyx_GOTREF(__pyx_tuple__29);
23544  __Pyx_GIVEREF(__pyx_tuple__29);
23545 
23546  /* "csmoothers.pyx":5
23547  * cimport numpy as np
23548  *
23549  * class ASMFactor(object): # <<<<<<<<<<<<<<
23550  *
23551  * def __init__(self, L):
23552  */
23553  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 5, __pyx_L1_error)
23554  __Pyx_GOTREF(__pyx_tuple__30);
23555  __Pyx_GIVEREF(__pyx_tuple__30);
23556 
23557  /* "csmoothers.pyx":7
23558  * class ASMFactor(object):
23559  *
23560  * def __init__(self, L): # <<<<<<<<<<<<<<
23561  * self.L = L
23562  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
23563  */
23564  __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_L); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 7, __pyx_L1_error)
23565  __Pyx_GOTREF(__pyx_tuple__31);
23566  __Pyx_GIVEREF(__pyx_tuple__31);
23567  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 7, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 7, __pyx_L1_error)
23568 
23569  /* "csmoothers.pyx":42
23570  *
23571  *
23572  * class BASMFactor(object): # <<<<<<<<<<<<<<
23573  *
23574  * def __init__(self, L, bs):
23575  */
23576  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 42, __pyx_L1_error)
23577  __Pyx_GOTREF(__pyx_tuple__33);
23578  __Pyx_GIVEREF(__pyx_tuple__33);
23579 
23580  /* "csmoothers.pyx":44
23581  * class BASMFactor(object):
23582  *
23583  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
23584  * self.L = L
23585  * self.bs = bs
23586  */
23587  __pyx_tuple__34 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_L, __pyx_n_s_bs); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 44, __pyx_L1_error)
23588  __Pyx_GOTREF(__pyx_tuple__34);
23589  __Pyx_GIVEREF(__pyx_tuple__34);
23590  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 44, __pyx_L1_error)
23591 
23592  /* "csmoothers.pyx":84
23593  * self.subdomain_col_pivots)
23594  *
23595  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
23596  * """
23597  *
23598  */
23599  __pyx_tuple__36 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 84, __pyx_L1_error)
23600  __Pyx_GOTREF(__pyx_tuple__36);
23601  __Pyx_GIVEREF(__pyx_tuple__36);
23602  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_prepare, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 84, __pyx_L1_error)
23603 
23604  /* "csmoothers.pyx":109
23605  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
23606  *
23607  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
23608  * """
23609  *
23610  */
23611  __pyx_tuple__38 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 109, __pyx_L1_error)
23612  __Pyx_GOTREF(__pyx_tuple__38);
23613  __Pyx_GIVEREF(__pyx_tuple__38);
23614  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_solve, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 109, __pyx_L1_error)
23615 
23616  /* "csmoothers.pyx":136
23617  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23618  *
23619  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
23620  * """
23621  *
23622  */
23623  __pyx_tuple__40 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 136, __pyx_L1_error)
23624  __Pyx_GOTREF(__pyx_tuple__40);
23625  __Pyx_GIVEREF(__pyx_tuple__40);
23626  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_jacobi_NR_solve, 136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 136, __pyx_L1_error)
23627 
23628  /* "csmoothers.pyx":165
23629  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23630  *
23631  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
23632  * """
23633  *
23634  */
23635  __pyx_tuple__42 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 165, __pyx_L1_error)
23636  __Pyx_GOTREF(__pyx_tuple__42);
23637  __Pyx_GIVEREF(__pyx_tuple__42);
23638  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_preare, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 165, __pyx_L1_error)
23639 
23640  /* "csmoothers.pyx":190
23641  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
23642  *
23643  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
23644  * """
23645  *
23646  */
23647  __pyx_tuple__44 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 190, __pyx_L1_error)
23648  __Pyx_GOTREF(__pyx_tuple__44);
23649  __Pyx_GIVEREF(__pyx_tuple__44);
23650  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_solve, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 190, __pyx_L1_error)
23651 
23652  /* "csmoothers.pyx":217
23653  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23654  *
23655  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
23656  * """
23657  *
23658  */
23659  __pyx_tuple__46 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 217, __pyx_L1_error)
23660  __Pyx_GOTREF(__pyx_tuple__46);
23661  __Pyx_GIVEREF(__pyx_tuple__46);
23662  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_gauss_seidel_NR_solve, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 217, __pyx_L1_error)
23663 
23664  /* "csmoothers.pyx":251
23665  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23666  *
23667  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
23668  * """
23669  *
23670  */
23671  __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_asmFactor); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 251, __pyx_L1_error)
23672  __Pyx_GOTREF(__pyx_tuple__48);
23673  __Pyx_GIVEREF(__pyx_tuple__48);
23674  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_prepare, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 251, __pyx_L1_error)
23675 
23676  /* "csmoothers.pyx":277
23677  * asmFactor.subdomain_pivots)
23678  *
23679  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
23680  * """
23681  *
23682  */
23683  __pyx_tuple__50 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_asmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 277, __pyx_L1_error)
23684  __Pyx_GOTREF(__pyx_tuple__50);
23685  __Pyx_GIVEREF(__pyx_tuple__50);
23686  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_solve, 277, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 277, __pyx_L1_error)
23687 
23688  /* "csmoothers.pyx":321
23689  * asmFactor.subdomain_pivots)
23690  *
23691  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
23692  * """
23693  *
23694  */
23695  __pyx_tuple__52 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_basmFactor); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 321, __pyx_L1_error)
23696  __Pyx_GOTREF(__pyx_tuple__52);
23697  __Pyx_GIVEREF(__pyx_tuple__52);
23698  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_prepare, 321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 321, __pyx_L1_error)
23699 
23700  /* "csmoothers.pyx":350
23701  *
23702  *
23703  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
23704  * """
23705  *
23706  */
23707  __pyx_tuple__54 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_basmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 350, __pyx_L1_error)
23708  __Pyx_GOTREF(__pyx_tuple__54);
23709  __Pyx_GIVEREF(__pyx_tuple__54);
23710  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_solve, 350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 350, __pyx_L1_error)
23711 
23712  /* "View.MemoryView":286
23713  * return self.name
23714  *
23715  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23716  * cdef strided = Enum("<strided and direct>") # default
23717  * cdef indirect = Enum("<strided and indirect>")
23718  */
23719  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 286, __pyx_L1_error)
23720  __Pyx_GOTREF(__pyx_tuple__56);
23721  __Pyx_GIVEREF(__pyx_tuple__56);
23722 
23723  /* "View.MemoryView":287
23724  *
23725  * cdef generic = Enum("<strided and direct or indirect>")
23726  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23727  * cdef indirect = Enum("<strided and indirect>")
23728  *
23729  */
23730  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 287, __pyx_L1_error)
23731  __Pyx_GOTREF(__pyx_tuple__57);
23732  __Pyx_GIVEREF(__pyx_tuple__57);
23733 
23734  /* "View.MemoryView":288
23735  * cdef generic = Enum("<strided and direct or indirect>")
23736  * cdef strided = Enum("<strided and direct>") # default
23737  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23738  *
23739  *
23740  */
23741  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 288, __pyx_L1_error)
23742  __Pyx_GOTREF(__pyx_tuple__58);
23743  __Pyx_GIVEREF(__pyx_tuple__58);
23744 
23745  /* "View.MemoryView":291
23746  *
23747  *
23748  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23749  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23750  *
23751  */
23752  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 291, __pyx_L1_error)
23753  __Pyx_GOTREF(__pyx_tuple__59);
23754  __Pyx_GIVEREF(__pyx_tuple__59);
23755 
23756  /* "View.MemoryView":292
23757  *
23758  * cdef contiguous = Enum("<contiguous and direct>")
23759  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23760  *
23761  *
23762  */
23763  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 292, __pyx_L1_error)
23764  __Pyx_GOTREF(__pyx_tuple__60);
23765  __Pyx_GIVEREF(__pyx_tuple__60);
23766 
23767  /* "(tree fragment)":1
23768  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23769  * cdef object __pyx_PickleError
23770  * cdef object __pyx_result
23771  */
23772  __pyx_tuple__61 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 1, __pyx_L1_error)
23773  __Pyx_GOTREF(__pyx_tuple__61);
23774  __Pyx_GIVEREF(__pyx_tuple__61);
23775  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(1, 1, __pyx_L1_error)
23776  __Pyx_RefNannyFinishContext();
23777  return 0;
23778  __pyx_L1_error:;
23779  __Pyx_RefNannyFinishContext();
23780  return -1;
23781 }
23782 
23783 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
23784  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23785  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23786  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23787  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23788  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23789  return 0;
23790  __pyx_L1_error:;
23791  return -1;
23792 }
23793 
23794 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
23795 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
23796 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
23797 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
23798 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
23799 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
23800 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
23801 
23802 static int __Pyx_modinit_global_init_code(void) {
23803  __Pyx_RefNannyDeclarations
23804  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
23805  /*--- Global init code ---*/
23806  generic = Py_None; Py_INCREF(Py_None);
23807  strided = Py_None; Py_INCREF(Py_None);
23808  indirect = Py_None; Py_INCREF(Py_None);
23809  contiguous = Py_None; Py_INCREF(Py_None);
23810  indirect_contiguous = Py_None; Py_INCREF(Py_None);
23811  __Pyx_RefNannyFinishContext();
23812  return 0;
23813 }
23814 
23815 static int __Pyx_modinit_variable_export_code(void) {
23816  __Pyx_RefNannyDeclarations
23817  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
23818  /*--- Variable export code ---*/
23819  __Pyx_RefNannyFinishContext();
23820  return 0;
23821 }
23822 
23823 static int __Pyx_modinit_function_export_code(void) {
23824  __Pyx_RefNannyDeclarations
23825  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
23826  /*--- Function export code ---*/
23827  __Pyx_RefNannyFinishContext();
23828  return 0;
23829 }
23830 
23831 static int __Pyx_modinit_type_init_code(void) {
23832  __Pyx_RefNannyDeclarations
23833  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
23834  /*--- Type init code ---*/
23835  if (PyType_Ready(&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23836  #if PY_VERSION_HEX < 0x030800B1
23837  __pyx_type_10csmoothers_cASMFactor.tp_print = 0;
23838  #endif
23839  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
23840  __pyx_type_10csmoothers_cASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23841  }
23842  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cASMFactor_2, (PyObject *)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23843  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23844  __pyx_ptype_10csmoothers_cASMFactor = &__pyx_type_10csmoothers_cASMFactor;
23845  if (PyType_Ready(&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23846  #if PY_VERSION_HEX < 0x030800B1
23847  __pyx_type_10csmoothers_cBASMFactor.tp_print = 0;
23848  #endif
23849  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cBASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cBASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
23850  __pyx_type_10csmoothers_cBASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23851  }
23852  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cBASMFactor_2, (PyObject *)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23853  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23854  __pyx_ptype_10csmoothers_cBASMFactor = &__pyx_type_10csmoothers_cBASMFactor;
23855  __pyx_vtabptr_array = &__pyx_vtable_array;
23856  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
23857  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23858  #if PY_VERSION_HEX < 0x030800B1
23859  __pyx_type___pyx_array.tp_print = 0;
23860  #endif
23861  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23862  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23863  __pyx_array_type = &__pyx_type___pyx_array;
23864  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23865  #if PY_VERSION_HEX < 0x030800B1
23866  __pyx_type___pyx_MemviewEnum.tp_print = 0;
23867  #endif
23868  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23869  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23870  }
23871  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23872  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23873  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23874  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23875  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23876  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23877  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23878  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23879  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
23880  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23881  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23882  #if PY_VERSION_HEX < 0x030800B1
23883  __pyx_type___pyx_memoryview.tp_print = 0;
23884  #endif
23885  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23886  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23887  }
23888  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23889  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23890  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23891  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23892  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23893  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
23894  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23895  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23896  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23897  #if PY_VERSION_HEX < 0x030800B1
23898  __pyx_type___pyx_memoryviewslice.tp_print = 0;
23899  #endif
23900  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23901  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23902  }
23903  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23904  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23905  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23906  __Pyx_RefNannyFinishContext();
23907  return 0;
23908  __pyx_L1_error:;
23909  __Pyx_RefNannyFinishContext();
23910  return -1;
23911 }
23912 
23913 static int __Pyx_modinit_type_import_code(void) {
23914  __Pyx_RefNannyDeclarations
23915  PyObject *__pyx_t_1 = NULL;
23916  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
23917  /*--- Type import code ---*/
23918  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
23919  __Pyx_GOTREF(__pyx_t_1);
23920  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
23921  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23922  sizeof(PyTypeObject),
23923  #else
23924  sizeof(PyHeapTypeObject),
23925  #endif
23926  __Pyx_ImportType_CheckSize_Warn);
23927  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
23928  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23929  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 206, __pyx_L1_error)
23930  __Pyx_GOTREF(__pyx_t_1);
23931  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23932  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 206, __pyx_L1_error)
23933  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
23934  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 229, __pyx_L1_error)
23935  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
23936  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 233, __pyx_L1_error)
23937  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23938  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 242, __pyx_L1_error)
23939  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
23940  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 918, __pyx_L1_error)
23941  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23942  __pyx_t_1 = PyImport_ImportModule("proteus.superluWrappers"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 67, __pyx_L1_error)
23943  __Pyx_GOTREF(__pyx_t_1);
23944  __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = __Pyx_ImportType(__pyx_t_1, "proteus.superluWrappers", "cSparseMatrix", sizeof(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix), __Pyx_ImportType_CheckSize_Warn);
23945  if (!__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix) __PYX_ERR(4, 67, __pyx_L1_error)
23946  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23947  __Pyx_RefNannyFinishContext();
23948  return 0;
23949  __pyx_L1_error:;
23950  __Pyx_XDECREF(__pyx_t_1);
23951  __Pyx_RefNannyFinishContext();
23952  return -1;
23953 }
23954 
23955 static int __Pyx_modinit_variable_import_code(void) {
23956  __Pyx_RefNannyDeclarations
23957  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
23958  /*--- Variable import code ---*/
23959  __Pyx_RefNannyFinishContext();
23960  return 0;
23961 }
23962 
23963 static int __Pyx_modinit_function_import_code(void) {
23964  __Pyx_RefNannyDeclarations
23965  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
23966  /*--- Function import code ---*/
23967  __Pyx_RefNannyFinishContext();
23968  return 0;
23969 }
23970 
23971 
23972 #if PY_MAJOR_VERSION < 3
23973 #ifdef CYTHON_NO_PYINIT_EXPORT
23974 #define __Pyx_PyMODINIT_FUNC void
23975 #else
23976 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23977 #endif
23978 #else
23979 #ifdef CYTHON_NO_PYINIT_EXPORT
23980 #define __Pyx_PyMODINIT_FUNC PyObject *
23981 #else
23982 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23983 #endif
23984 #endif
23985 
23986 
23987 #if PY_MAJOR_VERSION < 3
23988 __Pyx_PyMODINIT_FUNC initcsmoothers(void) CYTHON_SMALL_CODE; /*proto*/
23989 __Pyx_PyMODINIT_FUNC initcsmoothers(void)
23990 #else
23991 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(void) CYTHON_SMALL_CODE; /*proto*/
23992 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(void)
23993 #if CYTHON_PEP489_MULTI_PHASE_INIT
23994 {
23995  return PyModuleDef_Init(&__pyx_moduledef);
23996 }
23997 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
23998  #if PY_VERSION_HEX >= 0x030700A1
23999  static PY_INT64_T main_interpreter_id = -1;
24000  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
24001  if (main_interpreter_id == -1) {
24002  main_interpreter_id = current_id;
24003  return (unlikely(current_id == -1)) ? -1 : 0;
24004  } else if (unlikely(main_interpreter_id != current_id))
24005  #else
24006  static PyInterpreterState *main_interpreter = NULL;
24007  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
24008  if (!main_interpreter) {
24009  main_interpreter = current_interpreter;
24010  } else if (unlikely(main_interpreter != current_interpreter))
24011  #endif
24012  {
24013  PyErr_SetString(
24014  PyExc_ImportError,
24015  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
24016  return -1;
24017  }
24018  return 0;
24019 }
24020 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
24021  PyObject *value = PyObject_GetAttrString(spec, from_name);
24022  int result = 0;
24023  if (likely(value)) {
24024  if (allow_none || value != Py_None) {
24025  result = PyDict_SetItemString(moddict, to_name, value);
24026  }
24027  Py_DECREF(value);
24028  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
24029  PyErr_Clear();
24030  } else {
24031  result = -1;
24032  }
24033  return result;
24034 }
24035 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
24036  PyObject *module = NULL, *moddict, *modname;
24037  if (__Pyx_check_single_interpreter())
24038  return NULL;
24039  if (__pyx_m)
24040  return __Pyx_NewRef(__pyx_m);
24041  modname = PyObject_GetAttrString(spec, "name");
24042  if (unlikely(!modname)) goto bad;
24043  module = PyModule_NewObject(modname);
24044  Py_DECREF(modname);
24045  if (unlikely(!module)) goto bad;
24046  moddict = PyModule_GetDict(module);
24047  if (unlikely(!moddict)) goto bad;
24048  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
24049  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
24050  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
24051  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
24052  return module;
24053 bad:
24054  Py_XDECREF(module);
24055  return NULL;
24056 }
24057 
24058 
24059 static CYTHON_SMALL_CODE int __pyx_pymod_exec_csmoothers(PyObject *__pyx_pyinit_module)
24060 #endif
24061 #endif
24062 {
24063  PyObject *__pyx_t_1 = NULL;
24064  PyObject *__pyx_t_2 = NULL;
24065  PyObject *__pyx_t_3 = NULL;
24066  static PyThread_type_lock __pyx_t_4[8];
24067  __Pyx_RefNannyDeclarations
24068  #if CYTHON_PEP489_MULTI_PHASE_INIT
24069  if (__pyx_m) {
24070  if (__pyx_m == __pyx_pyinit_module) return 0;
24071  PyErr_SetString(PyExc_RuntimeError, "Module 'csmoothers' has already been imported. Re-initialisation is not supported.");
24072  return -1;
24073  }
24074  #elif PY_MAJOR_VERSION >= 3
24075  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
24076  #endif
24077  #if CYTHON_REFNANNY
24078 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
24079 if (!__Pyx_RefNanny) {
24080  PyErr_Clear();
24081  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
24082  if (!__Pyx_RefNanny)
24083  Py_FatalError("failed to import 'refnanny' module");
24084 }
24085 #endif
24086  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_csmoothers(void)", 0);
24087  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24088  #ifdef __Pxy_PyFrame_Initialize_Offsets
24089  __Pxy_PyFrame_Initialize_Offsets();
24090  #endif
24091  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
24092  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
24093  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
24094  #ifdef __Pyx_CyFunction_USED
24095  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24096  #endif
24097  #ifdef __Pyx_FusedFunction_USED
24098  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24099  #endif
24100  #ifdef __Pyx_Coroutine_USED
24101  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24102  #endif
24103  #ifdef __Pyx_Generator_USED
24104  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24105  #endif
24106  #ifdef __Pyx_AsyncGen_USED
24107  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24108  #endif
24109  #ifdef __Pyx_StopAsyncIteration_USED
24110  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24111  #endif
24112  /*--- Library function declarations ---*/
24113  /*--- Threads initialization code ---*/
24114  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
24115  #ifdef WITH_THREAD /* Python build with threading support? */
24116  PyEval_InitThreads();
24117  #endif
24118  #endif
24119  /*--- Module creation code ---*/
24120  #if CYTHON_PEP489_MULTI_PHASE_INIT
24121  __pyx_m = __pyx_pyinit_module;
24122  Py_INCREF(__pyx_m);
24123  #else
24124  #if PY_MAJOR_VERSION < 3
24125  __pyx_m = Py_InitModule4("csmoothers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
24126  #else
24127  __pyx_m = PyModule_Create(&__pyx_moduledef);
24128  #endif
24129  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
24130  #endif
24131  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
24132  Py_INCREF(__pyx_d);
24133  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
24134  Py_INCREF(__pyx_b);
24135  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
24136  Py_INCREF(__pyx_cython_runtime);
24137  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
24138  /*--- Initialize various global constants etc. ---*/
24139  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24140  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
24141  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24142  #endif
24143  if (__pyx_module_is_main_csmoothers) {
24144  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24145  }
24146  #if PY_MAJOR_VERSION >= 3
24147  {
24148  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
24149  if (!PyDict_GetItemString(modules, "csmoothers")) {
24150  if (unlikely(PyDict_SetItemString(modules, "csmoothers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
24151  }
24152  }
24153  #endif
24154  /*--- Builtin init code ---*/
24155  if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
24156  /*--- Constants init code ---*/
24157  if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
24158  /*--- Global type/function init code ---*/
24159  (void)__Pyx_modinit_global_init_code();
24160  (void)__Pyx_modinit_variable_export_code();
24161  (void)__Pyx_modinit_function_export_code();
24162  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
24163  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
24164  (void)__Pyx_modinit_variable_import_code();
24165  (void)__Pyx_modinit_function_import_code();
24166  /*--- Execution code ---*/
24167  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
24168  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24169  #endif
24170 
24171  /* "csmoothers.pyx":1
24172  * import numpy as np # <<<<<<<<<<<<<<
24173  * import cython
24174  * cimport numpy as np
24175  */
24176  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24177  __Pyx_GOTREF(__pyx_t_1);
24178  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24179  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24180 
24181  /* "csmoothers.pyx":5
24182  * cimport numpy as np
24183  *
24184  * class ASMFactor(object): # <<<<<<<<<<<<<<
24185  *
24186  * def __init__(self, L):
24187  */
24188  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__30); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
24189  __Pyx_GOTREF(__pyx_t_1);
24190  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__30, __pyx_n_s_ASMFactor, __pyx_n_s_ASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
24191  __Pyx_GOTREF(__pyx_t_2);
24192 
24193  /* "csmoothers.pyx":7
24194  * class ASMFactor(object):
24195  *
24196  * def __init__(self, L): # <<<<<<<<<<<<<<
24197  * self.L = L
24198  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
24199  */
24200  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10csmoothers_9ASMFactor_1__init__, 0, __pyx_n_s_ASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error)
24201  __Pyx_GOTREF(__pyx_t_3);
24202  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
24203  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24204 
24205  /* "csmoothers.pyx":5
24206  * cimport numpy as np
24207  *
24208  * class ASMFactor(object): # <<<<<<<<<<<<<<
24209  *
24210  * def __init__(self, L):
24211  */
24212  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ASMFactor, __pyx_tuple__30, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
24213  __Pyx_GOTREF(__pyx_t_3);
24214  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
24215  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24216  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24217  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24218 
24219  /* "csmoothers.pyx":42
24220  *
24221  *
24222  * class BASMFactor(object): # <<<<<<<<<<<<<<
24223  *
24224  * def __init__(self, L, bs):
24225  */
24226  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__33); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
24227  __Pyx_GOTREF(__pyx_t_1);
24228  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__33, __pyx_n_s_BASMFactor, __pyx_n_s_BASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
24229  __Pyx_GOTREF(__pyx_t_2);
24230 
24231  /* "csmoothers.pyx":44
24232  * class BASMFactor(object):
24233  *
24234  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
24235  * self.L = L
24236  * self.bs = bs
24237  */
24238  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10csmoothers_10BASMFactor_1__init__, 0, __pyx_n_s_BASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
24239  __Pyx_GOTREF(__pyx_t_3);
24240  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
24241  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24242 
24243  /* "csmoothers.pyx":42
24244  *
24245  *
24246  * class BASMFactor(object): # <<<<<<<<<<<<<<
24247  *
24248  * def __init__(self, L, bs):
24249  */
24250  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_BASMFactor, __pyx_tuple__33, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
24251  __Pyx_GOTREF(__pyx_t_3);
24252  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
24253  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24254  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24255  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24256 
24257  /* "csmoothers.pyx":84
24258  * self.subdomain_col_pivots)
24259  *
24260  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
24261  * """
24262  *
24263  */
24264  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_1jacobi_NR_prepare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
24265  __Pyx_GOTREF(__pyx_t_1);
24266  if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
24267  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24268 
24269  /* "csmoothers.pyx":109
24270  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
24271  *
24272  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
24273  * """
24274  *
24275  */
24276  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_3jacobi_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
24277  __Pyx_GOTREF(__pyx_t_1);
24278  if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
24279  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24280 
24281  /* "csmoothers.pyx":136
24282  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
24283  *
24284  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
24285  * """
24286  *
24287  */
24288  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_5nl_jacobi_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
24289  __Pyx_GOTREF(__pyx_t_1);
24290  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
24291  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24292 
24293  /* "csmoothers.pyx":165
24294  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
24295  *
24296  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
24297  * """
24298  *
24299  */
24300  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_7gauss_seidel_NR_preare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
24301  __Pyx_GOTREF(__pyx_t_1);
24302  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_preare, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
24303  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24304 
24305  /* "csmoothers.pyx":190
24306  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
24307  *
24308  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
24309  * """
24310  *
24311  */
24312  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_9gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
24313  __Pyx_GOTREF(__pyx_t_1);
24314  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
24315  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24316 
24317  /* "csmoothers.pyx":217
24318  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
24319  *
24320  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
24321  * """
24322  *
24323  */
24324  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
24325  __Pyx_GOTREF(__pyx_t_1);
24326  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
24327  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24328 
24329  /* "csmoothers.pyx":251
24330  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
24331  *
24332  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
24333  * """
24334  *
24335  */
24336  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_13asm_NR_prepare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
24337  __Pyx_GOTREF(__pyx_t_1);
24338  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 251, __pyx_L1_error)
24339  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24340 
24341  /* "csmoothers.pyx":277
24342  * asmFactor.subdomain_pivots)
24343  *
24344  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
24345  * """
24346  *
24347  */
24348  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_15asm_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
24349  __Pyx_GOTREF(__pyx_t_1);
24350  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
24351  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24352 
24353  /* "csmoothers.pyx":321
24354  * asmFactor.subdomain_pivots)
24355  *
24356  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
24357  * """
24358  *
24359  */
24360  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_17basm_NR_prepare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
24361  __Pyx_GOTREF(__pyx_t_1);
24362  if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
24363  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24364 
24365  /* "csmoothers.pyx":350
24366  *
24367  *
24368  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
24369  * """
24370  *
24371  */
24372  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_19basm_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
24373  __Pyx_GOTREF(__pyx_t_1);
24374  if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
24375  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24376 
24377  /* "csmoothers.pyx":1
24378  * import numpy as np # <<<<<<<<<<<<<<
24379  * import cython
24380  * cimport numpy as np
24381  */
24382  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24383  __Pyx_GOTREF(__pyx_t_1);
24384  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24385  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24386 
24387  /* "View.MemoryView":209
24388  * info.obj = self
24389  *
24390  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24391  *
24392  * def __dealloc__(array self):
24393  */
24394  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
24395  __Pyx_GOTREF(__pyx_t_1);
24396  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
24397  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24398  PyType_Modified(__pyx_array_type);
24399 
24400  /* "View.MemoryView":286
24401  * return self.name
24402  *
24403  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
24404  * cdef strided = Enum("<strided and direct>") # default
24405  * cdef indirect = Enum("<strided and indirect>")
24406  */
24407  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
24408  __Pyx_GOTREF(__pyx_t_1);
24409  __Pyx_XGOTREF(generic);
24410  __Pyx_DECREF_SET(generic, __pyx_t_1);
24411  __Pyx_GIVEREF(__pyx_t_1);
24412  __pyx_t_1 = 0;
24413 
24414  /* "View.MemoryView":287
24415  *
24416  * cdef generic = Enum("<strided and direct or indirect>")
24417  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
24418  * cdef indirect = Enum("<strided and indirect>")
24419  *
24420  */
24421  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
24422  __Pyx_GOTREF(__pyx_t_1);
24423  __Pyx_XGOTREF(strided);
24424  __Pyx_DECREF_SET(strided, __pyx_t_1);
24425  __Pyx_GIVEREF(__pyx_t_1);
24426  __pyx_t_1 = 0;
24427 
24428  /* "View.MemoryView":288
24429  * cdef generic = Enum("<strided and direct or indirect>")
24430  * cdef strided = Enum("<strided and direct>") # default
24431  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
24432  *
24433  *
24434  */
24435  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
24436  __Pyx_GOTREF(__pyx_t_1);
24437  __Pyx_XGOTREF(indirect);
24438  __Pyx_DECREF_SET(indirect, __pyx_t_1);
24439  __Pyx_GIVEREF(__pyx_t_1);
24440  __pyx_t_1 = 0;
24441 
24442  /* "View.MemoryView":291
24443  *
24444  *
24445  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
24446  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
24447  *
24448  */
24449  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
24450  __Pyx_GOTREF(__pyx_t_1);
24451  __Pyx_XGOTREF(contiguous);
24452  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
24453  __Pyx_GIVEREF(__pyx_t_1);
24454  __pyx_t_1 = 0;
24455 
24456  /* "View.MemoryView":292
24457  *
24458  * cdef contiguous = Enum("<contiguous and direct>")
24459  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
24460  *
24461  *
24462  */
24463  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
24464  __Pyx_GOTREF(__pyx_t_1);
24465  __Pyx_XGOTREF(indirect_contiguous);
24466  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
24467  __Pyx_GIVEREF(__pyx_t_1);
24468  __pyx_t_1 = 0;
24469 
24470  /* "View.MemoryView":316
24471  *
24472  * DEF THREAD_LOCKS_PREALLOCATED = 8
24473  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
24474  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
24475  * PyThread_allocate_lock(),
24476  */
24477  __pyx_memoryview_thread_locks_used = 0;
24478 
24479  /* "View.MemoryView":317
24480  * DEF THREAD_LOCKS_PREALLOCATED = 8
24481  * cdef int __pyx_memoryview_thread_locks_used = 0
24482  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
24483  * PyThread_allocate_lock(),
24484  * PyThread_allocate_lock(),
24485  */
24486  __pyx_t_4[0] = PyThread_allocate_lock();
24487  __pyx_t_4[1] = PyThread_allocate_lock();
24488  __pyx_t_4[2] = PyThread_allocate_lock();
24489  __pyx_t_4[3] = PyThread_allocate_lock();
24490  __pyx_t_4[4] = PyThread_allocate_lock();
24491  __pyx_t_4[5] = PyThread_allocate_lock();
24492  __pyx_t_4[6] = PyThread_allocate_lock();
24493  __pyx_t_4[7] = PyThread_allocate_lock();
24494  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
24495 
24496  /* "View.MemoryView":549
24497  * info.obj = self
24498  *
24499  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24500  *
24501  *
24502  */
24503  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
24504  __Pyx_GOTREF(__pyx_t_1);
24505  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
24506  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24507  PyType_Modified(__pyx_memoryview_type);
24508 
24509  /* "View.MemoryView":995
24510  * return self.from_object
24511  *
24512  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24513  *
24514  *
24515  */
24516  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
24517  __Pyx_GOTREF(__pyx_t_1);
24518  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
24519  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24520  PyType_Modified(__pyx_memoryviewslice_type);
24521 
24522  /* "(tree fragment)":1
24523  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
24524  * cdef object __pyx_PickleError
24525  * cdef object __pyx_result
24526  */
24527  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24528  __Pyx_GOTREF(__pyx_t_1);
24529  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24530  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24531 
24532  /* "(tree fragment)":11
24533  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
24534  * return __pyx_result
24535  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
24536  * __pyx_result.name = __pyx_state[0]
24537  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
24538  */
24539 
24540  /*--- Wrapped vars code ---*/
24541 
24542  goto __pyx_L0;
24543  __pyx_L1_error:;
24544  __Pyx_XDECREF(__pyx_t_1);
24545  __Pyx_XDECREF(__pyx_t_2);
24546  __Pyx_XDECREF(__pyx_t_3);
24547  if (__pyx_m) {
24548  if (__pyx_d) {
24549  __Pyx_AddTraceback("init csmoothers", __pyx_clineno, __pyx_lineno, __pyx_filename);
24550  }
24551  Py_CLEAR(__pyx_m);
24552  } else if (!PyErr_Occurred()) {
24553  PyErr_SetString(PyExc_ImportError, "init csmoothers");
24554  }
24555  __pyx_L0:;
24556  __Pyx_RefNannyFinishContext();
24557  #if CYTHON_PEP489_MULTI_PHASE_INIT
24558  return (__pyx_m != NULL) ? 0 : -1;
24559  #elif PY_MAJOR_VERSION >= 3
24560  return __pyx_m;
24561  #else
24562  return;
24563  #endif
24564 }
24565 
24566 /* --- Runtime support code --- */
24567 /* Refnanny */
24568 #if CYTHON_REFNANNY
24569 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
24570  PyObject *m = NULL, *p = NULL;
24571  void *r = NULL;
24572  m = PyImport_ImportModule(modname);
24573  if (!m) goto end;
24574  p = PyObject_GetAttrString(m, "RefNannyAPI");
24575  if (!p) goto end;
24576  r = PyLong_AsVoidPtr(p);
24577 end:
24578  Py_XDECREF(p);
24579  Py_XDECREF(m);
24580  return (__Pyx_RefNannyAPIStruct *)r;
24581 }
24582 #endif
24583 
24584 /* PyObjectGetAttrStr */
24585 #if CYTHON_USE_TYPE_SLOTS
24586 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24587  PyTypeObject* tp = Py_TYPE(obj);
24588  if (likely(tp->tp_getattro))
24589  return tp->tp_getattro(obj, attr_name);
24590 #if PY_MAJOR_VERSION < 3
24591  if (likely(tp->tp_getattr))
24592  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24593 #endif
24594  return PyObject_GetAttr(obj, attr_name);
24595 }
24596 #endif
24597 
24598 /* GetBuiltinName */
24599 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24600  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24601  if (unlikely(!result)) {
24602  PyErr_Format(PyExc_NameError,
24603 #if PY_MAJOR_VERSION >= 3
24604  "name '%U' is not defined", name);
24605 #else
24606  "name '%.200s' is not defined", PyString_AS_STRING(name));
24607 #endif
24608  }
24609  return result;
24610 }
24611 
24612 /* RaiseArgTupleInvalid */
24613 static void __Pyx_RaiseArgtupleInvalid(
24614  const char* func_name,
24615  int exact,
24616  Py_ssize_t num_min,
24617  Py_ssize_t num_max,
24618  Py_ssize_t num_found)
24619 {
24620  Py_ssize_t num_expected;
24621  const char *more_or_less;
24622  if (num_found < num_min) {
24623  num_expected = num_min;
24624  more_or_less = "at least";
24625  } else {
24626  num_expected = num_max;
24627  more_or_less = "at most";
24628  }
24629  if (exact) {
24630  more_or_less = "exactly";
24631  }
24632  PyErr_Format(PyExc_TypeError,
24633  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
24634  func_name, more_or_less, num_expected,
24635  (num_expected == 1) ? "" : "s", num_found);
24636 }
24637 
24638 /* RaiseDoubleKeywords */
24639 static void __Pyx_RaiseDoubleKeywordsError(
24640  const char* func_name,
24641  PyObject* kw_name)
24642 {
24643  PyErr_Format(PyExc_TypeError,
24644  #if PY_MAJOR_VERSION >= 3
24645  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24646  #else
24647  "%s() got multiple values for keyword argument '%s'", func_name,
24648  PyString_AsString(kw_name));
24649  #endif
24650 }
24651 
24652 /* ParseKeywords */
24653 static int __Pyx_ParseOptionalKeywords(
24654  PyObject *kwds,
24655  PyObject **argnames[],
24656  PyObject *kwds2,
24657  PyObject *values[],
24658  Py_ssize_t num_pos_args,
24659  const char* function_name)
24660 {
24661  PyObject *key = 0, *value = 0;
24662  Py_ssize_t pos = 0;
24663  PyObject*** name;
24664  PyObject*** first_kw_arg = argnames + num_pos_args;
24665  while (PyDict_Next(kwds, &pos, &key, &value)) {
24666  name = first_kw_arg;
24667  while (*name && (**name != key)) name++;
24668  if (*name) {
24669  values[name-argnames] = value;
24670  continue;
24671  }
24672  name = first_kw_arg;
24673  #if PY_MAJOR_VERSION < 3
24674  if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
24675  while (*name) {
24676  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24677  && _PyString_Eq(**name, key)) {
24678  values[name-argnames] = value;
24679  break;
24680  }
24681  name++;
24682  }
24683  if (*name) continue;
24684  else {
24685  PyObject*** argname = argnames;
24686  while (argname != first_kw_arg) {
24687  if ((**argname == key) || (
24688  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24689  && _PyString_Eq(**argname, key))) {
24690  goto arg_passed_twice;
24691  }
24692  argname++;
24693  }
24694  }
24695  } else
24696  #endif
24697  if (likely(PyUnicode_Check(key))) {
24698  while (*name) {
24699  int cmp = (**name == key) ? 0 :
24700  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24701  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
24702  #endif
24703  PyUnicode_Compare(**name, key);
24704  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24705  if (cmp == 0) {
24706  values[name-argnames] = value;
24707  break;
24708  }
24709  name++;
24710  }
24711  if (*name) continue;
24712  else {
24713  PyObject*** argname = argnames;
24714  while (argname != first_kw_arg) {
24715  int cmp = (**argname == key) ? 0 :
24716  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24717  (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
24718  #endif
24719  PyUnicode_Compare(**argname, key);
24720  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24721  if (cmp == 0) goto arg_passed_twice;
24722  argname++;
24723  }
24724  }
24725  } else
24726  goto invalid_keyword_type;
24727  if (kwds2) {
24728  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
24729  } else {
24730  goto invalid_keyword;
24731  }
24732  }
24733  return 0;
24734 arg_passed_twice:
24735  __Pyx_RaiseDoubleKeywordsError(function_name, key);
24736  goto bad;
24737 invalid_keyword_type:
24738  PyErr_Format(PyExc_TypeError,
24739  "%.200s() keywords must be strings", function_name);
24740  goto bad;
24741 invalid_keyword:
24742  PyErr_Format(PyExc_TypeError,
24743  #if PY_MAJOR_VERSION < 3
24744  "%.200s() got an unexpected keyword argument '%.200s'",
24745  function_name, PyString_AsString(key));
24746  #else
24747  "%s() got an unexpected keyword argument '%U'",
24748  function_name, key);
24749  #endif
24750 bad:
24751  return -1;
24752 }
24753 
24754 /* PyObjectSetAttrStr */
24755 #if CYTHON_USE_TYPE_SLOTS
24756 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
24757  PyTypeObject* tp = Py_TYPE(obj);
24758  if (likely(tp->tp_setattro))
24759  return tp->tp_setattro(obj, attr_name, value);
24760 #if PY_MAJOR_VERSION < 3
24761  if (likely(tp->tp_setattr))
24762  return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
24763 #endif
24764  return PyObject_SetAttr(obj, attr_name, value);
24765 }
24766 #endif
24767 
24768 /* PyCFunctionFastCall */
24769 #if CYTHON_FAST_PYCCALL
24770 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24771  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24772  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24773  PyObject *self = PyCFunction_GET_SELF(func);
24774  int flags = PyCFunction_GET_FLAGS(func);
24775  assert(PyCFunction_Check(func));
24776  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24777  assert(nargs >= 0);
24778  assert(nargs == 0 || args != NULL);
24779  /* _PyCFunction_FastCallDict() must not be called with an exception set,
24780  because it may clear it (directly or indirectly) and so the
24781  caller loses its exception */
24782  assert(!PyErr_Occurred());
24783  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24784  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
24785  } else {
24786  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
24787  }
24788 }
24789 #endif
24790 
24791 /* PyFunctionFastCall */
24792 #if CYTHON_FAST_PYCALL
24793 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24794  PyObject *globals) {
24795  PyFrameObject *f;
24796  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24797  PyObject **fastlocals;
24798  Py_ssize_t i;
24799  PyObject *result;
24800  assert(globals != NULL);
24801  /* XXX Perhaps we should create a specialized
24802  PyFrame_New() that doesn't take locals, but does
24803  take builtins without sanity checking them.
24804  */
24805  assert(tstate != NULL);
24806  f = PyFrame_New(tstate, co, globals, NULL);
24807  if (f == NULL) {
24808  return NULL;
24809  }
24810  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24811  for (i = 0; i < na; i++) {
24812  Py_INCREF(*args);
24813  fastlocals[i] = *args++;
24814  }
24815  result = PyEval_EvalFrameEx(f,0);
24816  ++tstate->recursion_depth;
24817  Py_DECREF(f);
24818  --tstate->recursion_depth;
24819  return result;
24820 }
24821 #if 1 || PY_VERSION_HEX < 0x030600B1
24822 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24823  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24824  PyObject *globals = PyFunction_GET_GLOBALS(func);
24825  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24826  PyObject *closure;
24827 #if PY_MAJOR_VERSION >= 3
24828  PyObject *kwdefs;
24829 #endif
24830  PyObject *kwtuple, **k;
24831  PyObject **d;
24832  Py_ssize_t nd;
24833  Py_ssize_t nk;
24834  PyObject *result;
24835  assert(kwargs == NULL || PyDict_Check(kwargs));
24836  nk = kwargs ? PyDict_Size(kwargs) : 0;
24837  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
24838  return NULL;
24839  }
24840  if (
24841 #if PY_MAJOR_VERSION >= 3
24842  co->co_kwonlyargcount == 0 &&
24843 #endif
24844  likely(kwargs == NULL || nk == 0) &&
24845  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24846  if (argdefs == NULL && co->co_argcount == nargs) {
24847  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24848  goto done;
24849  }
24850  else if (nargs == 0 && argdefs != NULL
24851  && co->co_argcount == Py_SIZE(argdefs)) {
24852  /* function called with no arguments, but all parameters have
24853  a default value: use default values as arguments .*/
24854  args = &PyTuple_GET_ITEM(argdefs, 0);
24855  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24856  goto done;
24857  }
24858  }
24859  if (kwargs != NULL) {
24860  Py_ssize_t pos, i;
24861  kwtuple = PyTuple_New(2 * nk);
24862  if (kwtuple == NULL) {
24863  result = NULL;
24864  goto done;
24865  }
24866  k = &PyTuple_GET_ITEM(kwtuple, 0);
24867  pos = i = 0;
24868  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24869  Py_INCREF(k[i]);
24870  Py_INCREF(k[i+1]);
24871  i += 2;
24872  }
24873  nk = i / 2;
24874  }
24875  else {
24876  kwtuple = NULL;
24877  k = NULL;
24878  }
24879  closure = PyFunction_GET_CLOSURE(func);
24880 #if PY_MAJOR_VERSION >= 3
24881  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24882 #endif
24883  if (argdefs != NULL) {
24884  d = &PyTuple_GET_ITEM(argdefs, 0);
24885  nd = Py_SIZE(argdefs);
24886  }
24887  else {
24888  d = NULL;
24889  nd = 0;
24890  }
24891 #if PY_MAJOR_VERSION >= 3
24892  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24893  args, (int)nargs,
24894  k, (int)nk,
24895  d, (int)nd, kwdefs, closure);
24896 #else
24897  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24898  args, (int)nargs,
24899  k, (int)nk,
24900  d, (int)nd, closure);
24901 #endif
24902  Py_XDECREF(kwtuple);
24903 done:
24904  Py_LeaveRecursiveCall();
24905  return result;
24906 }
24907 #endif
24908 #endif
24909 
24910 /* PyObjectCall */
24911 #if CYTHON_COMPILING_IN_CPYTHON
24912 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24913  PyObject *result;
24914  ternaryfunc call = func->ob_type->tp_call;
24915  if (unlikely(!call))
24916  return PyObject_Call(func, arg, kw);
24917  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24918  return NULL;
24919  result = (*call)(func, arg, kw);
24920  Py_LeaveRecursiveCall();
24921  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24922  PyErr_SetString(
24923  PyExc_SystemError,
24924  "NULL result without error in PyObject_Call");
24925  }
24926  return result;
24927 }
24928 #endif
24929 
24930 /* PyObjectCallMethO */
24931 #if CYTHON_COMPILING_IN_CPYTHON
24932 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24933  PyObject *self, *result;
24934  PyCFunction cfunc;
24935  cfunc = PyCFunction_GET_FUNCTION(func);
24936  self = PyCFunction_GET_SELF(func);
24937  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24938  return NULL;
24939  result = cfunc(self, arg);
24940  Py_LeaveRecursiveCall();
24941  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24942  PyErr_SetString(
24943  PyExc_SystemError,
24944  "NULL result without error in PyObject_Call");
24945  }
24946  return result;
24947 }
24948 #endif
24949 
24950 /* PyObjectCallOneArg */
24951 #if CYTHON_COMPILING_IN_CPYTHON
24952 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24953  PyObject *result;
24954  PyObject *args = PyTuple_New(1);
24955  if (unlikely(!args)) return NULL;
24956  Py_INCREF(arg);
24957  PyTuple_SET_ITEM(args, 0, arg);
24958  result = __Pyx_PyObject_Call(func, args, NULL);
24959  Py_DECREF(args);
24960  return result;
24961 }
24962 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24963 #if CYTHON_FAST_PYCALL
24964  if (PyFunction_Check(func)) {
24965  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24966  }
24967 #endif
24968  if (likely(PyCFunction_Check(func))) {
24969  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24970  return __Pyx_PyObject_CallMethO(func, arg);
24971 #if CYTHON_FAST_PYCCALL
24972  } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24973  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24974 #endif
24975  }
24976  }
24977  return __Pyx__PyObject_CallOneArg(func, arg);
24978 }
24979 #else
24980 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24981  PyObject *result;
24982  PyObject *args = PyTuple_Pack(1, arg);
24983  if (unlikely(!args)) return NULL;
24984  result = __Pyx_PyObject_Call(func, args, NULL);
24985  Py_DECREF(args);
24986  return result;
24987 }
24988 #endif
24989 
24990 /* ArgTypeTest */
24991 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
24992 {
24993  if (unlikely(!type)) {
24994  PyErr_SetString(PyExc_SystemError, "Missing type object");
24995  return 0;
24996  }
24997  else if (exact) {
24998  #if PY_MAJOR_VERSION == 2
24999  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
25000  #endif
25001  }
25002  else {
25003  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
25004  }
25005  PyErr_Format(PyExc_TypeError,
25006  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
25007  name, type->tp_name, Py_TYPE(obj)->tp_name);
25008  return 0;
25009 }
25010 
25011 /* PyErrFetchRestore */
25012 #if CYTHON_FAST_THREAD_STATE
25013 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25014  PyObject *tmp_type, *tmp_value, *tmp_tb;
25015  tmp_type = tstate->curexc_type;
25016  tmp_value = tstate->curexc_value;
25017  tmp_tb = tstate->curexc_traceback;
25018  tstate->curexc_type = type;
25019  tstate->curexc_value = value;
25020  tstate->curexc_traceback = tb;
25021  Py_XDECREF(tmp_type);
25022  Py_XDECREF(tmp_value);
25023  Py_XDECREF(tmp_tb);
25024 }
25025 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25026  *type = tstate->curexc_type;
25027  *value = tstate->curexc_value;
25028  *tb = tstate->curexc_traceback;
25029  tstate->curexc_type = 0;
25030  tstate->curexc_value = 0;
25031  tstate->curexc_traceback = 0;
25032 }
25033 #endif
25034 
25035 /* RaiseException */
25036 #if PY_MAJOR_VERSION < 3
25037 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
25038  CYTHON_UNUSED PyObject *cause) {
25039  __Pyx_PyThreadState_declare
25040  Py_XINCREF(type);
25041  if (!value || value == Py_None)
25042  value = NULL;
25043  else
25044  Py_INCREF(value);
25045  if (!tb || tb == Py_None)
25046  tb = NULL;
25047  else {
25048  Py_INCREF(tb);
25049  if (!PyTraceBack_Check(tb)) {
25050  PyErr_SetString(PyExc_TypeError,
25051  "raise: arg 3 must be a traceback or None");
25052  goto raise_error;
25053  }
25054  }
25055  if (PyType_Check(type)) {
25056 #if CYTHON_COMPILING_IN_PYPY
25057  if (!value) {
25058  Py_INCREF(Py_None);
25059  value = Py_None;
25060  }
25061 #endif
25062  PyErr_NormalizeException(&type, &value, &tb);
25063  } else {
25064  if (value) {
25065  PyErr_SetString(PyExc_TypeError,
25066  "instance exception may not have a separate value");
25067  goto raise_error;
25068  }
25069  value = type;
25070  type = (PyObject*) Py_TYPE(type);
25071  Py_INCREF(type);
25072  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
25073  PyErr_SetString(PyExc_TypeError,
25074  "raise: exception class must be a subclass of BaseException");
25075  goto raise_error;
25076  }
25077  }
25078  __Pyx_PyThreadState_assign
25079  __Pyx_ErrRestore(type, value, tb);
25080  return;
25081 raise_error:
25082  Py_XDECREF(value);
25083  Py_XDECREF(type);
25084  Py_XDECREF(tb);
25085  return;
25086 }
25087 #else
25088 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
25089  PyObject* owned_instance = NULL;
25090  if (tb == Py_None) {
25091  tb = 0;
25092  } else if (tb && !PyTraceBack_Check(tb)) {
25093  PyErr_SetString(PyExc_TypeError,
25094  "raise: arg 3 must be a traceback or None");
25095  goto bad;
25096  }
25097  if (value == Py_None)
25098  value = 0;
25099  if (PyExceptionInstance_Check(type)) {
25100  if (value) {
25101  PyErr_SetString(PyExc_TypeError,
25102  "instance exception may not have a separate value");
25103  goto bad;
25104  }
25105  value = type;
25106  type = (PyObject*) Py_TYPE(value);
25107  } else if (PyExceptionClass_Check(type)) {
25108  PyObject *instance_class = NULL;
25109  if (value && PyExceptionInstance_Check(value)) {
25110  instance_class = (PyObject*) Py_TYPE(value);
25111  if (instance_class != type) {
25112  int is_subclass = PyObject_IsSubclass(instance_class, type);
25113  if (!is_subclass) {
25114  instance_class = NULL;
25115  } else if (unlikely(is_subclass == -1)) {
25116  goto bad;
25117  } else {
25118  type = instance_class;
25119  }
25120  }
25121  }
25122  if (!instance_class) {
25123  PyObject *args;
25124  if (!value)
25125  args = PyTuple_New(0);
25126  else if (PyTuple_Check(value)) {
25127  Py_INCREF(value);
25128  args = value;
25129  } else
25130  args = PyTuple_Pack(1, value);
25131  if (!args)
25132  goto bad;
25133  owned_instance = PyObject_Call(type, args, NULL);
25134  Py_DECREF(args);
25135  if (!owned_instance)
25136  goto bad;
25137  value = owned_instance;
25138  if (!PyExceptionInstance_Check(value)) {
25139  PyErr_Format(PyExc_TypeError,
25140  "calling %R should have returned an instance of "
25141  "BaseException, not %R",
25142  type, Py_TYPE(value));
25143  goto bad;
25144  }
25145  }
25146  } else {
25147  PyErr_SetString(PyExc_TypeError,
25148  "raise: exception class must be a subclass of BaseException");
25149  goto bad;
25150  }
25151  if (cause) {
25152  PyObject *fixed_cause;
25153  if (cause == Py_None) {
25154  fixed_cause = NULL;
25155  } else if (PyExceptionClass_Check(cause)) {
25156  fixed_cause = PyObject_CallObject(cause, NULL);
25157  if (fixed_cause == NULL)
25158  goto bad;
25159  } else if (PyExceptionInstance_Check(cause)) {
25160  fixed_cause = cause;
25161  Py_INCREF(fixed_cause);
25162  } else {
25163  PyErr_SetString(PyExc_TypeError,
25164  "exception causes must derive from "
25165  "BaseException");
25166  goto bad;
25167  }
25168  PyException_SetCause(value, fixed_cause);
25169  }
25170  PyErr_SetObject(type, value);
25171  if (tb) {
25172 #if CYTHON_COMPILING_IN_PYPY
25173  PyObject *tmp_type, *tmp_value, *tmp_tb;
25174  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
25175  Py_INCREF(tb);
25176  PyErr_Restore(tmp_type, tmp_value, tb);
25177  Py_XDECREF(tmp_tb);
25178 #else
25179  PyThreadState *tstate = __Pyx_PyThreadState_Current;
25180  PyObject* tmp_tb = tstate->curexc_traceback;
25181  if (tb != tmp_tb) {
25182  Py_INCREF(tb);
25183  tstate->curexc_traceback = tb;
25184  Py_XDECREF(tmp_tb);
25185  }
25186 #endif
25187  }
25188 bad:
25189  Py_XDECREF(owned_instance);
25190  return;
25191 }
25192 #endif
25193 
25194 /* ExtTypeTest */
25195 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25196  if (unlikely(!type)) {
25197  PyErr_SetString(PyExc_SystemError, "Missing type object");
25198  return 0;
25199  }
25200  if (likely(__Pyx_TypeCheck(obj, type)))
25201  return 1;
25202  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
25203  Py_TYPE(obj)->tp_name, type->tp_name);
25204  return 0;
25205 }
25206 
25207 /* MemviewSliceInit */
25208 static int
25209 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
25210  int ndim,
25211  __Pyx_memviewslice *memviewslice,
25212  int memview_is_new_reference)
25213 {
25214  __Pyx_RefNannyDeclarations
25215  int i, retval=-1;
25216  Py_buffer *buf = &memview->view;
25217  __Pyx_RefNannySetupContext("init_memviewslice", 0);
25218  if (memviewslice->memview || memviewslice->data) {
25219  PyErr_SetString(PyExc_ValueError,
25220  "memviewslice is already initialized!");
25221  goto fail;
25222  }
25223  if (buf->strides) {
25224  for (i = 0; i < ndim; i++) {
25225  memviewslice->strides[i] = buf->strides[i];
25226  }
25227  } else {
25228  Py_ssize_t stride = buf->itemsize;
25229  for (i = ndim - 1; i >= 0; i--) {
25230  memviewslice->strides[i] = stride;
25231  stride *= buf->shape[i];
25232  }
25233  }
25234  for (i = 0; i < ndim; i++) {
25235  memviewslice->shape[i] = buf->shape[i];
25236  if (buf->suboffsets) {
25237  memviewslice->suboffsets[i] = buf->suboffsets[i];
25238  } else {
25239  memviewslice->suboffsets[i] = -1;
25240  }
25241  }
25242  memviewslice->memview = memview;
25243  memviewslice->data = (char *)buf->buf;
25244  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
25245  Py_INCREF(memview);
25246  }
25247  retval = 0;
25248  goto no_fail;
25249 fail:
25250  memviewslice->memview = 0;
25251  memviewslice->data = 0;
25252  retval = -1;
25253 no_fail:
25254  __Pyx_RefNannyFinishContext();
25255  return retval;
25256 }
25257 #ifndef Py_NO_RETURN
25258 #define Py_NO_RETURN
25259 #endif
25260 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
25261  va_list vargs;
25262  char msg[200];
25263 #ifdef HAVE_STDARG_PROTOTYPES
25264  va_start(vargs, fmt);
25265 #else
25266  va_start(vargs);
25267 #endif
25268  vsnprintf(msg, 200, fmt, vargs);
25269  va_end(vargs);
25270  Py_FatalError(msg);
25271 }
25272 static CYTHON_INLINE int
25273 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
25274  PyThread_type_lock lock)
25275 {
25276  int result;
25277  PyThread_acquire_lock(lock, 1);
25278  result = (*acquisition_count)++;
25279  PyThread_release_lock(lock);
25280  return result;
25281 }
25282 static CYTHON_INLINE int
25283 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
25284  PyThread_type_lock lock)
25285 {
25286  int result;
25287  PyThread_acquire_lock(lock, 1);
25288  result = (*acquisition_count)--;
25289  PyThread_release_lock(lock);
25290  return result;
25291 }
25292 static CYTHON_INLINE void
25293 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
25294 {
25295  int first_time;
25296  struct __pyx_memoryview_obj *memview = memslice->memview;
25297  if (!memview || (PyObject *) memview == Py_None)
25298  return;
25299  if (__pyx_get_slice_count(memview) < 0)
25300  __pyx_fatalerror("Acquisition count is %d (line %d)",
25301  __pyx_get_slice_count(memview), lineno);
25302  first_time = __pyx_add_acquisition_count(memview) == 0;
25303  if (first_time) {
25304  if (have_gil) {
25305  Py_INCREF((PyObject *) memview);
25306  } else {
25307  PyGILState_STATE _gilstate = PyGILState_Ensure();
25308  Py_INCREF((PyObject *) memview);
25309  PyGILState_Release(_gilstate);
25310  }
25311  }
25312 }
25313 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
25314  int have_gil, int lineno) {
25315  int last_time;
25316  struct __pyx_memoryview_obj *memview = memslice->memview;
25317  if (!memview ) {
25318  return;
25319  } else if ((PyObject *) memview == Py_None) {
25320  memslice->memview = NULL;
25321  return;
25322  }
25323  if (__pyx_get_slice_count(memview) <= 0)
25324  __pyx_fatalerror("Acquisition count is %d (line %d)",
25325  __pyx_get_slice_count(memview), lineno);
25326  last_time = __pyx_sub_acquisition_count(memview) == 1;
25327  memslice->data = NULL;
25328  if (last_time) {
25329  if (have_gil) {
25330  Py_CLEAR(memslice->memview);
25331  } else {
25332  PyGILState_STATE _gilstate = PyGILState_Ensure();
25333  Py_CLEAR(memslice->memview);
25334  PyGILState_Release(_gilstate);
25335  }
25336  } else {
25337  memslice->memview = NULL;
25338  }
25339 }
25340 
25341 /* BufferIndexError */
25342 static void __Pyx_RaiseBufferIndexError(int axis) {
25343  PyErr_Format(PyExc_IndexError,
25344  "Out of bounds on buffer access (axis %d)", axis);
25345 }
25346 
25347 /* WriteUnraisableException */
25348 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
25349  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
25350  int full_traceback, CYTHON_UNUSED int nogil) {
25351  PyObject *old_exc, *old_val, *old_tb;
25352  PyObject *ctx;
25353  __Pyx_PyThreadState_declare
25354 #ifdef WITH_THREAD
25355  PyGILState_STATE state;
25356  if (nogil)
25357  state = PyGILState_Ensure();
25358 #ifdef _MSC_VER
25359  else state = (PyGILState_STATE)-1;
25360 #endif
25361 #endif
25362  __Pyx_PyThreadState_assign
25363  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
25364  if (full_traceback) {
25365  Py_XINCREF(old_exc);
25366  Py_XINCREF(old_val);
25367  Py_XINCREF(old_tb);
25368  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25369  PyErr_PrintEx(1);
25370  }
25371  #if PY_MAJOR_VERSION < 3
25372  ctx = PyString_FromString(name);
25373  #else
25374  ctx = PyUnicode_FromString(name);
25375  #endif
25376  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25377  if (!ctx) {
25378  PyErr_WriteUnraisable(Py_None);
25379  } else {
25380  PyErr_WriteUnraisable(ctx);
25381  Py_DECREF(ctx);
25382  }
25383 #ifdef WITH_THREAD
25384  if (nogil)
25385  PyGILState_Release(state);
25386 #endif
25387 }
25388 
25389 /* DictGetItem */
25390 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
25391 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
25392  PyObject *value;
25393  value = PyDict_GetItemWithError(d, key);
25394  if (unlikely(!value)) {
25395  if (!PyErr_Occurred()) {
25396  if (unlikely(PyTuple_Check(key))) {
25397  PyObject* args = PyTuple_Pack(1, key);
25398  if (likely(args)) {
25399  PyErr_SetObject(PyExc_KeyError, args);
25400  Py_DECREF(args);
25401  }
25402  } else {
25403  PyErr_SetObject(PyExc_KeyError, key);
25404  }
25405  }
25406  return NULL;
25407  }
25408  Py_INCREF(value);
25409  return value;
25410 }
25411 #endif
25412 
25413 /* RaiseTooManyValuesToUnpack */
25414 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25415  PyErr_Format(PyExc_ValueError,
25416  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
25417 }
25418 
25419 /* RaiseNeedMoreValuesToUnpack */
25420 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25421  PyErr_Format(PyExc_ValueError,
25422  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
25423  index, (index == 1) ? "" : "s");
25424 }
25425 
25426 /* RaiseNoneIterError */
25427 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
25428  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
25429 }
25430 
25431 /* GetTopmostException */
25432 #if CYTHON_USE_EXC_INFO_STACK
25433 static _PyErr_StackItem *
25434 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
25435 {
25436  _PyErr_StackItem *exc_info = tstate->exc_info;
25437  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
25438  exc_info->previous_item != NULL)
25439  {
25440  exc_info = exc_info->previous_item;
25441  }
25442  return exc_info;
25443 }
25444 #endif
25445 
25446 /* SaveResetException */
25447 #if CYTHON_FAST_THREAD_STATE
25448 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25449  #if CYTHON_USE_EXC_INFO_STACK
25450  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
25451  *type = exc_info->exc_type;
25452  *value = exc_info->exc_value;
25453  *tb = exc_info->exc_traceback;
25454  #else
25455  *type = tstate->exc_type;
25456  *value = tstate->exc_value;
25457  *tb = tstate->exc_traceback;
25458  #endif
25459  Py_XINCREF(*type);
25460  Py_XINCREF(*value);
25461  Py_XINCREF(*tb);
25462 }
25463 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25464  PyObject *tmp_type, *tmp_value, *tmp_tb;
25465  #if CYTHON_USE_EXC_INFO_STACK
25466  _PyErr_StackItem *exc_info = tstate->exc_info;
25467  tmp_type = exc_info->exc_type;
25468  tmp_value = exc_info->exc_value;
25469  tmp_tb = exc_info->exc_traceback;
25470  exc_info->exc_type = type;
25471  exc_info->exc_value = value;
25472  exc_info->exc_traceback = tb;
25473  #else
25474  tmp_type = tstate->exc_type;
25475  tmp_value = tstate->exc_value;
25476  tmp_tb = tstate->exc_traceback;
25477  tstate->exc_type = type;
25478  tstate->exc_value = value;
25479  tstate->exc_traceback = tb;
25480  #endif
25481  Py_XDECREF(tmp_type);
25482  Py_XDECREF(tmp_value);
25483  Py_XDECREF(tmp_tb);
25484 }
25485 #endif
25486 
25487 /* PyErrExceptionMatches */
25488 #if CYTHON_FAST_THREAD_STATE
25489 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25490  Py_ssize_t i, n;
25491  n = PyTuple_GET_SIZE(tuple);
25492 #if PY_MAJOR_VERSION >= 3
25493  for (i=0; i<n; i++) {
25494  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25495  }
25496 #endif
25497  for (i=0; i<n; i++) {
25498  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
25499  }
25500  return 0;
25501 }
25502 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25503  PyObject *exc_type = tstate->curexc_type;
25504  if (exc_type == err) return 1;
25505  if (unlikely(!exc_type)) return 0;
25506  if (unlikely(PyTuple_Check(err)))
25507  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25508  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25509 }
25510 #endif
25511 
25512 /* GetException */
25513 #if CYTHON_FAST_THREAD_STATE
25514 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
25515 #else
25516 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
25517 #endif
25518 {
25519  PyObject *local_type, *local_value, *local_tb;
25520 #if CYTHON_FAST_THREAD_STATE
25521  PyObject *tmp_type, *tmp_value, *tmp_tb;
25522  local_type = tstate->curexc_type;
25523  local_value = tstate->curexc_value;
25524  local_tb = tstate->curexc_traceback;
25525  tstate->curexc_type = 0;
25526  tstate->curexc_value = 0;
25527  tstate->curexc_traceback = 0;
25528 #else
25529  PyErr_Fetch(&local_type, &local_value, &local_tb);
25530 #endif
25531  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25532 #if CYTHON_FAST_THREAD_STATE
25533  if (unlikely(tstate->curexc_type))
25534 #else
25535  if (unlikely(PyErr_Occurred()))
25536 #endif
25537  goto bad;
25538  #if PY_MAJOR_VERSION >= 3
25539  if (local_tb) {
25540  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25541  goto bad;
25542  }
25543  #endif
25544  Py_XINCREF(local_tb);
25545  Py_XINCREF(local_type);
25546  Py_XINCREF(local_value);
25547  *type = local_type;
25548  *value = local_value;
25549  *tb = local_tb;
25550 #if CYTHON_FAST_THREAD_STATE
25551  #if CYTHON_USE_EXC_INFO_STACK
25552  {
25553  _PyErr_StackItem *exc_info = tstate->exc_info;
25554  tmp_type = exc_info->exc_type;
25555  tmp_value = exc_info->exc_value;
25556  tmp_tb = exc_info->exc_traceback;
25557  exc_info->exc_type = local_type;
25558  exc_info->exc_value = local_value;
25559  exc_info->exc_traceback = local_tb;
25560  }
25561  #else
25562  tmp_type = tstate->exc_type;
25563  tmp_value = tstate->exc_value;
25564  tmp_tb = tstate->exc_traceback;
25565  tstate->exc_type = local_type;
25566  tstate->exc_value = local_value;
25567  tstate->exc_traceback = local_tb;
25568  #endif
25569  Py_XDECREF(tmp_type);
25570  Py_XDECREF(tmp_value);
25571  Py_XDECREF(tmp_tb);
25572 #else
25573  PyErr_SetExcInfo(local_type, local_value, local_tb);
25574 #endif
25575  return 0;
25576 bad:
25577  *type = 0;
25578  *value = 0;
25579  *tb = 0;
25580  Py_XDECREF(local_type);
25581  Py_XDECREF(local_value);
25582  Py_XDECREF(local_tb);
25583  return -1;
25584 }
25585 
25586 /* PyObjectCall2Args */
25587 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
25588  PyObject *args, *result = NULL;
25589  #if CYTHON_FAST_PYCALL
25590  if (PyFunction_Check(function)) {
25591  PyObject *args[2] = {arg1, arg2};
25592  return __Pyx_PyFunction_FastCall(function, args, 2);
25593  }
25594  #endif
25595  #if CYTHON_FAST_PYCCALL
25596  if (__Pyx_PyFastCFunction_Check(function)) {
25597  PyObject *args[2] = {arg1, arg2};
25598  return __Pyx_PyCFunction_FastCall(function, args, 2);
25599  }
25600  #endif
25601  args = PyTuple_New(2);
25602  if (unlikely(!args)) goto done;
25603  Py_INCREF(arg1);
25604  PyTuple_SET_ITEM(args, 0, arg1);
25605  Py_INCREF(arg2);
25606  PyTuple_SET_ITEM(args, 1, arg2);
25607  Py_INCREF(function);
25608  result = __Pyx_PyObject_Call(function, args, NULL);
25609  Py_DECREF(args);
25610  Py_DECREF(function);
25611 done:
25612  return result;
25613 }
25614 
25615 /* BytesEquals */
25616 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
25617 #if CYTHON_COMPILING_IN_PYPY
25618  return PyObject_RichCompareBool(s1, s2, equals);
25619 #else
25620  if (s1 == s2) {
25621  return (equals == Py_EQ);
25622  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
25623  const char *ps1, *ps2;
25624  Py_ssize_t length = PyBytes_GET_SIZE(s1);
25625  if (length != PyBytes_GET_SIZE(s2))
25626  return (equals == Py_NE);
25627  ps1 = PyBytes_AS_STRING(s1);
25628  ps2 = PyBytes_AS_STRING(s2);
25629  if (ps1[0] != ps2[0]) {
25630  return (equals == Py_NE);
25631  } else if (length == 1) {
25632  return (equals == Py_EQ);
25633  } else {
25634  int result;
25635 #if CYTHON_USE_UNICODE_INTERNALS
25636  Py_hash_t hash1, hash2;
25637  hash1 = ((PyBytesObject*)s1)->ob_shash;
25638  hash2 = ((PyBytesObject*)s2)->ob_shash;
25639  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25640  return (equals == Py_NE);
25641  }
25642 #endif
25643  result = memcmp(ps1, ps2, (size_t)length);
25644  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25645  }
25646  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
25647  return (equals == Py_NE);
25648  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
25649  return (equals == Py_NE);
25650  } else {
25651  int result;
25652  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25653  if (!py_result)
25654  return -1;
25655  result = __Pyx_PyObject_IsTrue(py_result);
25656  Py_DECREF(py_result);
25657  return result;
25658  }
25659 #endif
25660 }
25661 
25662 /* UnicodeEquals */
25663 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
25664 #if CYTHON_COMPILING_IN_PYPY
25665  return PyObject_RichCompareBool(s1, s2, equals);
25666 #else
25667 #if PY_MAJOR_VERSION < 3
25668  PyObject* owned_ref = NULL;
25669 #endif
25670  int s1_is_unicode, s2_is_unicode;
25671  if (s1 == s2) {
25672  goto return_eq;
25673  }
25674  s1_is_unicode = PyUnicode_CheckExact(s1);
25675  s2_is_unicode = PyUnicode_CheckExact(s2);
25676 #if PY_MAJOR_VERSION < 3
25677  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25678  owned_ref = PyUnicode_FromObject(s2);
25679  if (unlikely(!owned_ref))
25680  return -1;
25681  s2 = owned_ref;
25682  s2_is_unicode = 1;
25683  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25684  owned_ref = PyUnicode_FromObject(s1);
25685  if (unlikely(!owned_ref))
25686  return -1;
25687  s1 = owned_ref;
25688  s1_is_unicode = 1;
25689  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25690  return __Pyx_PyBytes_Equals(s1, s2, equals);
25691  }
25692 #endif
25693  if (s1_is_unicode & s2_is_unicode) {
25694  Py_ssize_t length;
25695  int kind;
25696  void *data1, *data2;
25697  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25698  return -1;
25699  length = __Pyx_PyUnicode_GET_LENGTH(s1);
25700  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25701  goto return_ne;
25702  }
25703 #if CYTHON_USE_UNICODE_INTERNALS
25704  {
25705  Py_hash_t hash1, hash2;
25706  #if CYTHON_PEP393_ENABLED
25707  hash1 = ((PyASCIIObject*)s1)->hash;
25708  hash2 = ((PyASCIIObject*)s2)->hash;
25709  #else
25710  hash1 = ((PyUnicodeObject*)s1)->hash;
25711  hash2 = ((PyUnicodeObject*)s2)->hash;
25712  #endif
25713  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25714  goto return_ne;
25715  }
25716  }
25717 #endif
25718  kind = __Pyx_PyUnicode_KIND(s1);
25719  if (kind != __Pyx_PyUnicode_KIND(s2)) {
25720  goto return_ne;
25721  }
25722  data1 = __Pyx_PyUnicode_DATA(s1);
25723  data2 = __Pyx_PyUnicode_DATA(s2);
25724  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25725  goto return_ne;
25726  } else if (length == 1) {
25727  goto return_eq;
25728  } else {
25729  int result = memcmp(data1, data2, (size_t)(length * kind));
25730  #if PY_MAJOR_VERSION < 3
25731  Py_XDECREF(owned_ref);
25732  #endif
25733  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25734  }
25735  } else if ((s1 == Py_None) & s2_is_unicode) {
25736  goto return_ne;
25737  } else if ((s2 == Py_None) & s1_is_unicode) {
25738  goto return_ne;
25739  } else {
25740  int result;
25741  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25742  #if PY_MAJOR_VERSION < 3
25743  Py_XDECREF(owned_ref);
25744  #endif
25745  if (!py_result)
25746  return -1;
25747  result = __Pyx_PyObject_IsTrue(py_result);
25748  Py_DECREF(py_result);
25749  return result;
25750  }
25751 return_eq:
25752  #if PY_MAJOR_VERSION < 3
25753  Py_XDECREF(owned_ref);
25754  #endif
25755  return (equals == Py_EQ);
25756 return_ne:
25757  #if PY_MAJOR_VERSION < 3
25758  Py_XDECREF(owned_ref);
25759  #endif
25760  return (equals == Py_NE);
25761 #endif
25762 }
25763 
25764 /* None */
25765 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
25766  Py_ssize_t q = a / b;
25767  Py_ssize_t r = a - q*b;
25768  q -= ((r != 0) & ((r ^ b) < 0));
25769  return q;
25770 }
25771 
25772 /* GetAttr */
25773 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
25774 #if CYTHON_USE_TYPE_SLOTS
25775 #if PY_MAJOR_VERSION >= 3
25776  if (likely(PyUnicode_Check(n)))
25777 #else
25778  if (likely(PyString_Check(n)))
25779 #endif
25780  return __Pyx_PyObject_GetAttrStr(o, n);
25781 #endif
25782  return PyObject_GetAttr(o, n);
25783 }
25784 
25785 /* GetItemInt */
25786 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
25787  PyObject *r;
25788  if (!j) return NULL;
25789  r = PyObject_GetItem(o, j);
25790  Py_DECREF(j);
25791  return r;
25792 }
25793 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
25794  CYTHON_NCP_UNUSED int wraparound,
25795  CYTHON_NCP_UNUSED int boundscheck) {
25796 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25797  Py_ssize_t wrapped_i = i;
25798  if (wraparound & unlikely(i < 0)) {
25799  wrapped_i += PyList_GET_SIZE(o);
25800  }
25801  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
25802  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
25803  Py_INCREF(r);
25804  return r;
25805  }
25806  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25807 #else
25808  return PySequence_GetItem(o, i);
25809 #endif
25810 }
25811 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
25812  CYTHON_NCP_UNUSED int wraparound,
25813  CYTHON_NCP_UNUSED int boundscheck) {
25814 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25815  Py_ssize_t wrapped_i = i;
25816  if (wraparound & unlikely(i < 0)) {
25817  wrapped_i += PyTuple_GET_SIZE(o);
25818  }
25819  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
25820  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
25821  Py_INCREF(r);
25822  return r;
25823  }
25824  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25825 #else
25826  return PySequence_GetItem(o, i);
25827 #endif
25828 }
25829 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
25830  CYTHON_NCP_UNUSED int wraparound,
25831  CYTHON_NCP_UNUSED int boundscheck) {
25832 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
25833  if (is_list || PyList_CheckExact(o)) {
25834  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
25835  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
25836  PyObject *r = PyList_GET_ITEM(o, n);
25837  Py_INCREF(r);
25838  return r;
25839  }
25840  }
25841  else if (PyTuple_CheckExact(o)) {
25842  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
25843  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
25844  PyObject *r = PyTuple_GET_ITEM(o, n);
25845  Py_INCREF(r);
25846  return r;
25847  }
25848  } else {
25849  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
25850  if (likely(m && m->sq_item)) {
25851  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
25852  Py_ssize_t l = m->sq_length(o);
25853  if (likely(l >= 0)) {
25854  i += l;
25855  } else {
25856  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25857  return NULL;
25858  PyErr_Clear();
25859  }
25860  }
25861  return m->sq_item(o, i);
25862  }
25863  }
25864 #else
25865  if (is_list || PySequence_Check(o)) {
25866  return PySequence_GetItem(o, i);
25867  }
25868 #endif
25869  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25870 }
25871 
25872 /* ObjectGetItem */
25873 #if CYTHON_USE_TYPE_SLOTS
25874 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25875  PyObject *runerr;
25876  Py_ssize_t key_value;
25877  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25878  if (unlikely(!(m && m->sq_item))) {
25879  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25880  return NULL;
25881  }
25882  key_value = __Pyx_PyIndex_AsSsize_t(index);
25883  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25884  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25885  }
25886  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25887  PyErr_Clear();
25888  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25889  }
25890  return NULL;
25891 }
25892 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25893  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25894  if (likely(m && m->mp_subscript)) {
25895  return m->mp_subscript(obj, key);
25896  }
25897  return __Pyx_PyObject_GetIndex(obj, key);
25898 }
25899 #endif
25900 
25901 /* decode_c_string */
25902 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25903  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25904  const char* encoding, const char* errors,
25905  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
25906  Py_ssize_t length;
25907  if (unlikely((start < 0) | (stop < 0))) {
25908  size_t slen = strlen(cstring);
25909  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
25910  PyErr_SetString(PyExc_OverflowError,
25911  "c-string too long to convert to Python");
25912  return NULL;
25913  }
25914  length = (Py_ssize_t) slen;
25915  if (start < 0) {
25916  start += length;
25917  if (start < 0)
25918  start = 0;
25919  }
25920  if (stop < 0)
25921  stop += length;
25922  }
25923  length = stop - start;
25924  if (unlikely(length <= 0))
25925  return PyUnicode_FromUnicode(NULL, 0);
25926  cstring += start;
25927  if (decode_func) {
25928  return decode_func(cstring, length, errors);
25929  } else {
25930  return PyUnicode_Decode(cstring, length, encoding, errors);
25931  }
25932 }
25933 
25934 /* GetAttr3 */
25935 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25936  __Pyx_PyThreadState_declare
25937  __Pyx_PyThreadState_assign
25938  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25939  return NULL;
25940  __Pyx_PyErr_Clear();
25941  Py_INCREF(d);
25942  return d;
25943 }
25944 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25945  PyObject *r = __Pyx_GetAttr(o, n);
25946  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25947 }
25948 
25949 /* PyDictVersioning */
25950 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
25951 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
25952  PyObject *dict = Py_TYPE(obj)->tp_dict;
25953  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
25954 }
25955 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
25956  PyObject **dictptr = NULL;
25957  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
25958  if (offset) {
25959 #if CYTHON_COMPILING_IN_CPYTHON
25960  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
25961 #else
25962  dictptr = _PyObject_GetDictPtr(obj);
25963 #endif
25964  }
25965  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
25966 }
25967 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
25968  PyObject *dict = Py_TYPE(obj)->tp_dict;
25969  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
25970  return 0;
25971  return obj_dict_version == __Pyx_get_object_dict_version(obj);
25972 }
25973 #endif
25974 
25975 /* GetModuleGlobalName */
25976 #if CYTHON_USE_DICT_VERSIONS
25977 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
25978 #else
25979 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
25980 #endif
25981 {
25982  PyObject *result;
25983 #if !CYTHON_AVOID_BORROWED_REFS
25984 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
25985  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25986  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25987  if (likely(result)) {
25988  return __Pyx_NewRef(result);
25989  } else if (unlikely(PyErr_Occurred())) {
25990  return NULL;
25991  }
25992 #else
25993  result = PyDict_GetItem(__pyx_d, name);
25994  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25995  if (likely(result)) {
25996  return __Pyx_NewRef(result);
25997  }
25998 #endif
25999 #else
26000  result = PyObject_GetItem(__pyx_d, name);
26001  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
26002  if (likely(result)) {
26003  return __Pyx_NewRef(result);
26004  }
26005  PyErr_Clear();
26006 #endif
26007  return __Pyx_GetBuiltinName(name);
26008 }
26009 
26010 /* SwapException */
26011 #if CYTHON_FAST_THREAD_STATE
26012 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26013  PyObject *tmp_type, *tmp_value, *tmp_tb;
26014  #if CYTHON_USE_EXC_INFO_STACK
26015  _PyErr_StackItem *exc_info = tstate->exc_info;
26016  tmp_type = exc_info->exc_type;
26017  tmp_value = exc_info->exc_value;
26018  tmp_tb = exc_info->exc_traceback;
26019  exc_info->exc_type = *type;
26020  exc_info->exc_value = *value;
26021  exc_info->exc_traceback = *tb;
26022  #else
26023  tmp_type = tstate->exc_type;
26024  tmp_value = tstate->exc_value;
26025  tmp_tb = tstate->exc_traceback;
26026  tstate->exc_type = *type;
26027  tstate->exc_value = *value;
26028  tstate->exc_traceback = *tb;
26029  #endif
26030  *type = tmp_type;
26031  *value = tmp_value;
26032  *tb = tmp_tb;
26033 }
26034 #else
26035 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
26036  PyObject *tmp_type, *tmp_value, *tmp_tb;
26037  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
26038  PyErr_SetExcInfo(*type, *value, *tb);
26039  *type = tmp_type;
26040  *value = tmp_value;
26041  *tb = tmp_tb;
26042 }
26043 #endif
26044 
26045 /* Import */
26046 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
26047  PyObject *empty_list = 0;
26048  PyObject *module = 0;
26049  PyObject *global_dict = 0;
26050  PyObject *empty_dict = 0;
26051  PyObject *list;
26052  #if PY_MAJOR_VERSION < 3
26053  PyObject *py_import;
26054  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
26055  if (!py_import)
26056  goto bad;
26057  #endif
26058  if (from_list)
26059  list = from_list;
26060  else {
26061  empty_list = PyList_New(0);
26062  if (!empty_list)
26063  goto bad;
26064  list = empty_list;
26065  }
26066  global_dict = PyModule_GetDict(__pyx_m);
26067  if (!global_dict)
26068  goto bad;
26069  empty_dict = PyDict_New();
26070  if (!empty_dict)
26071  goto bad;
26072  {
26073  #if PY_MAJOR_VERSION >= 3
26074  if (level == -1) {
26075  if (strchr(__Pyx_MODULE_NAME, '.')) {
26076  module = PyImport_ImportModuleLevelObject(
26077  name, global_dict, empty_dict, list, 1);
26078  if (!module) {
26079  if (!PyErr_ExceptionMatches(PyExc_ImportError))
26080  goto bad;
26081  PyErr_Clear();
26082  }
26083  }
26084  level = 0;
26085  }
26086  #endif
26087  if (!module) {
26088  #if PY_MAJOR_VERSION < 3
26089  PyObject *py_level = PyInt_FromLong(level);
26090  if (!py_level)
26091  goto bad;
26092  module = PyObject_CallFunctionObjArgs(py_import,
26093  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
26094  Py_DECREF(py_level);
26095  #else
26096  module = PyImport_ImportModuleLevelObject(
26097  name, global_dict, empty_dict, list, level);
26098  #endif
26099  }
26100  }
26101 bad:
26102  #if PY_MAJOR_VERSION < 3
26103  Py_XDECREF(py_import);
26104  #endif
26105  Py_XDECREF(empty_list);
26106  Py_XDECREF(empty_dict);
26107  return module;
26108 }
26109 
26110 /* FastTypeChecks */
26111 #if CYTHON_COMPILING_IN_CPYTHON
26112 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
26113  while (a) {
26114  a = a->tp_base;
26115  if (a == b)
26116  return 1;
26117  }
26118  return b == &PyBaseObject_Type;
26119 }
26120 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
26121  PyObject *mro;
26122  if (a == b) return 1;
26123  mro = a->tp_mro;
26124  if (likely(mro)) {
26125  Py_ssize_t i, n;
26126  n = PyTuple_GET_SIZE(mro);
26127  for (i = 0; i < n; i++) {
26128  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26129  return 1;
26130  }
26131  return 0;
26132  }
26133  return __Pyx_InBases(a, b);
26134 }
26135 #if PY_MAJOR_VERSION == 2
26136 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
26137  PyObject *exception, *value, *tb;
26138  int res;
26139  __Pyx_PyThreadState_declare
26140  __Pyx_PyThreadState_assign
26141  __Pyx_ErrFetch(&exception, &value, &tb);
26142  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
26143  if (unlikely(res == -1)) {
26144  PyErr_WriteUnraisable(err);
26145  res = 0;
26146  }
26147  if (!res) {
26148  res = PyObject_IsSubclass(err, exc_type2);
26149  if (unlikely(res == -1)) {
26150  PyErr_WriteUnraisable(err);
26151  res = 0;
26152  }
26153  }
26154  __Pyx_ErrRestore(exception, value, tb);
26155  return res;
26156 }
26157 #else
26158 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
26159  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
26160  if (!res) {
26161  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
26162  }
26163  return res;
26164 }
26165 #endif
26166 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26167  Py_ssize_t i, n;
26168  assert(PyExceptionClass_Check(exc_type));
26169  n = PyTuple_GET_SIZE(tuple);
26170 #if PY_MAJOR_VERSION >= 3
26171  for (i=0; i<n; i++) {
26172  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
26173  }
26174 #endif
26175  for (i=0; i<n; i++) {
26176  PyObject *t = PyTuple_GET_ITEM(tuple, i);
26177  #if PY_MAJOR_VERSION < 3
26178  if (likely(exc_type == t)) return 1;
26179  #endif
26180  if (likely(PyExceptionClass_Check(t))) {
26181  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
26182  } else {
26183  }
26184  }
26185  return 0;
26186 }
26187 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
26188  if (likely(err == exc_type)) return 1;
26189  if (likely(PyExceptionClass_Check(err))) {
26190  if (likely(PyExceptionClass_Check(exc_type))) {
26191  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
26192  } else if (likely(PyTuple_Check(exc_type))) {
26193  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
26194  } else {
26195  }
26196  }
26197  return PyErr_GivenExceptionMatches(err, exc_type);
26198 }
26199 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
26200  assert(PyExceptionClass_Check(exc_type1));
26201  assert(PyExceptionClass_Check(exc_type2));
26202  if (likely(err == exc_type1 || err == exc_type2)) return 1;
26203  if (likely(PyExceptionClass_Check(err))) {
26204  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
26205  }
26206  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
26207 }
26208 #endif
26209 
26210 /* PyIntBinop */
26211 #if !CYTHON_COMPILING_IN_PYPY
26212 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
26213  (void)inplace;
26214  (void)zerodivision_check;
26215  #if PY_MAJOR_VERSION < 3
26216  if (likely(PyInt_CheckExact(op1))) {
26217  const long b = intval;
26218  long x;
26219  long a = PyInt_AS_LONG(op1);
26220  x = (long)((unsigned long)a + b);
26221  if (likely((x^a) >= 0 || (x^b) >= 0))
26222  return PyInt_FromLong(x);
26223  return PyLong_Type.tp_as_number->nb_add(op1, op2);
26224  }
26225  #endif
26226  #if CYTHON_USE_PYLONG_INTERNALS
26227  if (likely(PyLong_CheckExact(op1))) {
26228  const long b = intval;
26229  long a, x;
26230 #ifdef HAVE_LONG_LONG
26231  const PY_LONG_LONG llb = intval;
26232  PY_LONG_LONG lla, llx;
26233 #endif
26234  const digit* digits = ((PyLongObject*)op1)->ob_digit;
26235  const Py_ssize_t size = Py_SIZE(op1);
26236  if (likely(__Pyx_sst_abs(size) <= 1)) {
26237  a = likely(size) ? digits[0] : 0;
26238  if (size == -1) a = -a;
26239  } else {
26240  switch (size) {
26241  case -2:
26242  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26243  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26244  break;
26245 #ifdef HAVE_LONG_LONG
26246  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26247  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26248  goto long_long;
26249 #endif
26250  }
26251  CYTHON_FALLTHROUGH;
26252  case 2:
26253  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26254  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26255  break;
26256 #ifdef HAVE_LONG_LONG
26257  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26258  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26259  goto long_long;
26260 #endif
26261  }
26262  CYTHON_FALLTHROUGH;
26263  case -3:
26264  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26265  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26266  break;
26267 #ifdef HAVE_LONG_LONG
26268  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26269  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26270  goto long_long;
26271 #endif
26272  }
26273  CYTHON_FALLTHROUGH;
26274  case 3:
26275  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26276  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26277  break;
26278 #ifdef HAVE_LONG_LONG
26279  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26280  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26281  goto long_long;
26282 #endif
26283  }
26284  CYTHON_FALLTHROUGH;
26285  case -4:
26286  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26287  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26288  break;
26289 #ifdef HAVE_LONG_LONG
26290  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26291  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26292  goto long_long;
26293 #endif
26294  }
26295  CYTHON_FALLTHROUGH;
26296  case 4:
26297  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26298  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26299  break;
26300 #ifdef HAVE_LONG_LONG
26301  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26302  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26303  goto long_long;
26304 #endif
26305  }
26306  CYTHON_FALLTHROUGH;
26307  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
26308  }
26309  }
26310  x = a + b;
26311  return PyLong_FromLong(x);
26312 #ifdef HAVE_LONG_LONG
26313  long_long:
26314  llx = lla + llb;
26315  return PyLong_FromLongLong(llx);
26316 #endif
26317 
26318 
26319  }
26320  #endif
26321  if (PyFloat_CheckExact(op1)) {
26322  const long b = intval;
26323  double a = PyFloat_AS_DOUBLE(op1);
26324  double result;
26325  PyFPE_START_PROTECT("add", return NULL)
26326  result = ((double)a) + (double)b;
26327  PyFPE_END_PROTECT(result)
26328  return PyFloat_FromDouble(result);
26329  }
26330  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
26331 }
26332 #endif
26333 
26334 /* None */
26335 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
26336  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
26337 }
26338 
26339 /* None */
26340 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
26341  long q = a / b;
26342  long r = a - q*b;
26343  q -= ((r != 0) & ((r ^ b) < 0));
26344  return q;
26345 }
26346 
26347 /* ImportFrom */
26348 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
26349  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
26350  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
26351  PyErr_Format(PyExc_ImportError,
26352  #if PY_MAJOR_VERSION < 3
26353  "cannot import name %.230s", PyString_AS_STRING(name));
26354  #else
26355  "cannot import name %S", name);
26356  #endif
26357  }
26358  return value;
26359 }
26360 
26361 /* HasAttr */
26362 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
26363  PyObject *r;
26364  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
26365  PyErr_SetString(PyExc_TypeError,
26366  "hasattr(): attribute name must be string");
26367  return -1;
26368  }
26369  r = __Pyx_GetAttr(o, n);
26370  if (unlikely(!r)) {
26371  PyErr_Clear();
26372  return 0;
26373  } else {
26374  Py_DECREF(r);
26375  return 1;
26376  }
26377 }
26378 
26379 /* PyObject_GenericGetAttrNoDict */
26380 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26381 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
26382  PyErr_Format(PyExc_AttributeError,
26383 #if PY_MAJOR_VERSION >= 3
26384  "'%.50s' object has no attribute '%U'",
26385  tp->tp_name, attr_name);
26386 #else
26387  "'%.50s' object has no attribute '%.400s'",
26388  tp->tp_name, PyString_AS_STRING(attr_name));
26389 #endif
26390  return NULL;
26391 }
26392 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
26393  PyObject *descr;
26394  PyTypeObject *tp = Py_TYPE(obj);
26395  if (unlikely(!PyString_Check(attr_name))) {
26396  return PyObject_GenericGetAttr(obj, attr_name);
26397  }
26398  assert(!tp->tp_dictoffset);
26399  descr = _PyType_Lookup(tp, attr_name);
26400  if (unlikely(!descr)) {
26401  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
26402  }
26403  Py_INCREF(descr);
26404  #if PY_MAJOR_VERSION < 3
26405  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
26406  #endif
26407  {
26408  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
26409  if (unlikely(f)) {
26410  PyObject *res = f(descr, obj, (PyObject *)tp);
26411  Py_DECREF(descr);
26412  return res;
26413  }
26414  }
26415  return descr;
26416 }
26417 #endif
26418 
26419 /* PyObject_GenericGetAttr */
26420 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26421 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
26422  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
26423  return PyObject_GenericGetAttr(obj, attr_name);
26424  }
26425  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
26426 }
26427 #endif
26428 
26429 /* SetupReduce */
26430 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
26431  int ret;
26432  PyObject *name_attr;
26433  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
26434  if (likely(name_attr)) {
26435  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
26436  } else {
26437  ret = -1;
26438  }
26439  if (unlikely(ret < 0)) {
26440  PyErr_Clear();
26441  ret = 0;
26442  }
26443  Py_XDECREF(name_attr);
26444  return ret;
26445 }
26446 static int __Pyx_setup_reduce(PyObject* type_obj) {
26447  int ret = 0;
26448  PyObject *object_reduce = NULL;
26449  PyObject *object_reduce_ex = NULL;
26450  PyObject *reduce = NULL;
26451  PyObject *reduce_ex = NULL;
26452  PyObject *reduce_cython = NULL;
26453  PyObject *setstate = NULL;
26454  PyObject *setstate_cython = NULL;
26455 #if CYTHON_USE_PYTYPE_LOOKUP
26456  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
26457 #else
26458  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
26459 #endif
26460 #if CYTHON_USE_PYTYPE_LOOKUP
26461  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
26462 #else
26463  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
26464 #endif
26465  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
26466  if (reduce_ex == object_reduce_ex) {
26467 #if CYTHON_USE_PYTYPE_LOOKUP
26468  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
26469 #else
26470  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
26471 #endif
26472  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
26473  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
26474  reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto __PYX_BAD;
26475  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26476  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26477  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
26478  if (!setstate) PyErr_Clear();
26479  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
26480  setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto __PYX_BAD;
26481  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26482  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26483  }
26484  PyType_Modified((PyTypeObject*)type_obj);
26485  }
26486  }
26487  goto __PYX_GOOD;
26488 __PYX_BAD:
26489  if (!PyErr_Occurred())
26490  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26491  ret = -1;
26492 __PYX_GOOD:
26493 #if !CYTHON_USE_PYTYPE_LOOKUP
26494  Py_XDECREF(object_reduce);
26495  Py_XDECREF(object_reduce_ex);
26496 #endif
26497  Py_XDECREF(reduce);
26498  Py_XDECREF(reduce_ex);
26499  Py_XDECREF(reduce_cython);
26500  Py_XDECREF(setstate);
26501  Py_XDECREF(setstate_cython);
26502  return ret;
26503 }
26504 
26505 /* SetVTable */
26506 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
26507 #if PY_VERSION_HEX >= 0x02070000
26508  PyObject *ob = PyCapsule_New(vtable, 0, 0);
26509 #else
26510  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26511 #endif
26512  if (!ob)
26513  goto bad;
26514  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
26515  goto bad;
26516  Py_DECREF(ob);
26517  return 0;
26518 bad:
26519  Py_XDECREF(ob);
26520  return -1;
26521 }
26522 
26523 /* TypeImport */
26524 #ifndef __PYX_HAVE_RT_ImportType
26525 #define __PYX_HAVE_RT_ImportType
26526 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
26527  size_t size, enum __Pyx_ImportType_CheckSize check_size)
26528 {
26529  PyObject *result = 0;
26530  char warning[200];
26531  Py_ssize_t basicsize;
26532 #ifdef Py_LIMITED_API
26533  PyObject *py_basicsize;
26534 #endif
26535  result = PyObject_GetAttrString(module, class_name);
26536  if (!result)
26537  goto bad;
26538  if (!PyType_Check(result)) {
26539  PyErr_Format(PyExc_TypeError,
26540  "%.200s.%.200s is not a type object",
26541  module_name, class_name);
26542  goto bad;
26543  }
26544 #ifndef Py_LIMITED_API
26545  basicsize = ((PyTypeObject *)result)->tp_basicsize;
26546 #else
26547  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
26548  if (!py_basicsize)
26549  goto bad;
26550  basicsize = PyLong_AsSsize_t(py_basicsize);
26551  Py_DECREF(py_basicsize);
26552  py_basicsize = 0;
26553  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
26554  goto bad;
26555 #endif
26556  if ((size_t)basicsize < size) {
26557  PyErr_Format(PyExc_ValueError,
26558  "%.200s.%.200s size changed, may indicate binary incompatibility. "
26559  "Expected %zd from C header, got %zd from PyObject",
26560  module_name, class_name, size, basicsize);
26561  goto bad;
26562  }
26563  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
26564  PyErr_Format(PyExc_ValueError,
26565  "%.200s.%.200s size changed, may indicate binary incompatibility. "
26566  "Expected %zd from C header, got %zd from PyObject",
26567  module_name, class_name, size, basicsize);
26568  goto bad;
26569  }
26570  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
26571  PyOS_snprintf(warning, sizeof(warning),
26572  "%s.%s size changed, may indicate binary incompatibility. "
26573  "Expected %zd from C header, got %zd from PyObject",
26574  module_name, class_name, size, basicsize);
26575  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
26576  }
26577  return (PyTypeObject *)result;
26578 bad:
26579  Py_XDECREF(result);
26580  return NULL;
26581 }
26582 #endif
26583 
26584 /* CalculateMetaclass */
26585 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
26586  Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
26587  for (i=0; i < nbases; i++) {
26588  PyTypeObject *tmptype;
26589  PyObject *tmp = PyTuple_GET_ITEM(bases, i);
26590  tmptype = Py_TYPE(tmp);
26591 #if PY_MAJOR_VERSION < 3
26592  if (tmptype == &PyClass_Type)
26593  continue;
26594 #endif
26595  if (!metaclass) {
26596  metaclass = tmptype;
26597  continue;
26598  }
26599  if (PyType_IsSubtype(metaclass, tmptype))
26600  continue;
26601  if (PyType_IsSubtype(tmptype, metaclass)) {
26602  metaclass = tmptype;
26603  continue;
26604  }
26605  PyErr_SetString(PyExc_TypeError,
26606  "metaclass conflict: "
26607  "the metaclass of a derived class "
26608  "must be a (non-strict) subclass "
26609  "of the metaclasses of all its bases");
26610  return NULL;
26611  }
26612  if (!metaclass) {
26613 #if PY_MAJOR_VERSION < 3
26614  metaclass = &PyClass_Type;
26615 #else
26616  metaclass = &PyType_Type;
26617 #endif
26618  }
26619  Py_INCREF((PyObject*) metaclass);
26620  return (PyObject*) metaclass;
26621 }
26622 
26623 /* FetchCommonType */
26624 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
26625  PyObject* fake_module;
26626  PyTypeObject* cached_type = NULL;
26627  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
26628  if (!fake_module) return NULL;
26629  Py_INCREF(fake_module);
26630  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
26631  if (cached_type) {
26632  if (!PyType_Check((PyObject*)cached_type)) {
26633  PyErr_Format(PyExc_TypeError,
26634  "Shared Cython type %.200s is not a type object",
26635  type->tp_name);
26636  goto bad;
26637  }
26638  if (cached_type->tp_basicsize != type->tp_basicsize) {
26639  PyErr_Format(PyExc_TypeError,
26640  "Shared Cython type %.200s has the wrong size, try recompiling",
26641  type->tp_name);
26642  goto bad;
26643  }
26644  } else {
26645  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
26646  PyErr_Clear();
26647  if (PyType_Ready(type) < 0) goto bad;
26648  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
26649  goto bad;
26650  Py_INCREF(type);
26651  cached_type = type;
26652  }
26653 done:
26654  Py_DECREF(fake_module);
26655  return cached_type;
26656 bad:
26657  Py_XDECREF(cached_type);
26658  cached_type = NULL;
26659  goto done;
26660 }
26661 
26662 /* CythonFunction */
26663 #include <structmember.h>
26664 static PyObject *
26665 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
26666 {
26667  if (unlikely(op->func_doc == NULL)) {
26668  if (op->func.m_ml->ml_doc) {
26669 #if PY_MAJOR_VERSION >= 3
26670  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
26671 #else
26672  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
26673 #endif
26674  if (unlikely(op->func_doc == NULL))
26675  return NULL;
26676  } else {
26677  Py_INCREF(Py_None);
26678  return Py_None;
26679  }
26680  }
26681  Py_INCREF(op->func_doc);
26682  return op->func_doc;
26683 }
26684 static int
26685 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26686 {
26687  PyObject *tmp = op->func_doc;
26688  if (value == NULL) {
26689  value = Py_None;
26690  }
26691  Py_INCREF(value);
26692  op->func_doc = value;
26693  Py_XDECREF(tmp);
26694  return 0;
26695 }
26696 static PyObject *
26697 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26698 {
26699  if (unlikely(op->func_name == NULL)) {
26700 #if PY_MAJOR_VERSION >= 3
26701  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
26702 #else
26703  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
26704 #endif
26705  if (unlikely(op->func_name == NULL))
26706  return NULL;
26707  }
26708  Py_INCREF(op->func_name);
26709  return op->func_name;
26710 }
26711 static int
26712 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26713 {
26714  PyObject *tmp;
26715 #if PY_MAJOR_VERSION >= 3
26716  if (unlikely(value == NULL || !PyUnicode_Check(value)))
26717 #else
26718  if (unlikely(value == NULL || !PyString_Check(value)))
26719 #endif
26720  {
26721  PyErr_SetString(PyExc_TypeError,
26722  "__name__ must be set to a string object");
26723  return -1;
26724  }
26725  tmp = op->func_name;
26726  Py_INCREF(value);
26727  op->func_name = value;
26728  Py_XDECREF(tmp);
26729  return 0;
26730 }
26731 static PyObject *
26732 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26733 {
26734  Py_INCREF(op->func_qualname);
26735  return op->func_qualname;
26736 }
26737 static int
26738 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26739 {
26740  PyObject *tmp;
26741 #if PY_MAJOR_VERSION >= 3
26742  if (unlikely(value == NULL || !PyUnicode_Check(value)))
26743 #else
26744  if (unlikely(value == NULL || !PyString_Check(value)))
26745 #endif
26746  {
26747  PyErr_SetString(PyExc_TypeError,
26748  "__qualname__ must be set to a string object");
26749  return -1;
26750  }
26751  tmp = op->func_qualname;
26752  Py_INCREF(value);
26753  op->func_qualname = value;
26754  Py_XDECREF(tmp);
26755  return 0;
26756 }
26757 static PyObject *
26758 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
26759 {
26760  PyObject *self;
26761  self = m->func_closure;
26762  if (self == NULL)
26763  self = Py_None;
26764  Py_INCREF(self);
26765  return self;
26766 }
26767 static PyObject *
26768 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26769 {
26770  if (unlikely(op->func_dict == NULL)) {
26771  op->func_dict = PyDict_New();
26772  if (unlikely(op->func_dict == NULL))
26773  return NULL;
26774  }
26775  Py_INCREF(op->func_dict);
26776  return op->func_dict;
26777 }
26778 static int
26779 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26780 {
26781  PyObject *tmp;
26782  if (unlikely(value == NULL)) {
26783  PyErr_SetString(PyExc_TypeError,
26784  "function's dictionary may not be deleted");
26785  return -1;
26786  }
26787  if (unlikely(!PyDict_Check(value))) {
26788  PyErr_SetString(PyExc_TypeError,
26789  "setting function's dictionary to a non-dict");
26790  return -1;
26791  }
26792  tmp = op->func_dict;
26793  Py_INCREF(value);
26794  op->func_dict = value;
26795  Py_XDECREF(tmp);
26796  return 0;
26797 }
26798 static PyObject *
26799 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26800 {
26801  Py_INCREF(op->func_globals);
26802  return op->func_globals;
26803 }
26804 static PyObject *
26805 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26806 {
26807  Py_INCREF(Py_None);
26808  return Py_None;
26809 }
26810 static PyObject *
26811 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26812 {
26813  PyObject* result = (op->func_code) ? op->func_code : Py_None;
26814  Py_INCREF(result);
26815  return result;
26816 }
26817 static int
26818 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
26819  int result = 0;
26820  PyObject *res = op->defaults_getter((PyObject *) op);
26821  if (unlikely(!res))
26822  return -1;
26823  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26824  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
26825  Py_INCREF(op->defaults_tuple);
26826  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
26827  Py_INCREF(op->defaults_kwdict);
26828  #else
26829  op->defaults_tuple = PySequence_ITEM(res, 0);
26830  if (unlikely(!op->defaults_tuple)) result = -1;
26831  else {
26832  op->defaults_kwdict = PySequence_ITEM(res, 1);
26833  if (unlikely(!op->defaults_kwdict)) result = -1;
26834  }
26835  #endif
26836  Py_DECREF(res);
26837  return result;
26838 }
26839 static int
26840 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26841  PyObject* tmp;
26842  if (!value) {
26843  value = Py_None;
26844  } else if (value != Py_None && !PyTuple_Check(value)) {
26845  PyErr_SetString(PyExc_TypeError,
26846  "__defaults__ must be set to a tuple object");
26847  return -1;
26848  }
26849  Py_INCREF(value);
26850  tmp = op->defaults_tuple;
26851  op->defaults_tuple = value;
26852  Py_XDECREF(tmp);
26853  return 0;
26854 }
26855 static PyObject *
26856 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26857  PyObject* result = op->defaults_tuple;
26858  if (unlikely(!result)) {
26859  if (op->defaults_getter) {
26860  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
26861  result = op->defaults_tuple;
26862  } else {
26863  result = Py_None;
26864  }
26865  }
26866  Py_INCREF(result);
26867  return result;
26868 }
26869 static int
26870 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26871  PyObject* tmp;
26872  if (!value) {
26873  value = Py_None;
26874  } else if (value != Py_None && !PyDict_Check(value)) {
26875  PyErr_SetString(PyExc_TypeError,
26876  "__kwdefaults__ must be set to a dict object");
26877  return -1;
26878  }
26879  Py_INCREF(value);
26880  tmp = op->defaults_kwdict;
26881  op->defaults_kwdict = value;
26882  Py_XDECREF(tmp);
26883  return 0;
26884 }
26885 static PyObject *
26886 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26887  PyObject* result = op->defaults_kwdict;
26888  if (unlikely(!result)) {
26889  if (op->defaults_getter) {
26890  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
26891  result = op->defaults_kwdict;
26892  } else {
26893  result = Py_None;
26894  }
26895  }
26896  Py_INCREF(result);
26897  return result;
26898 }
26899 static int
26900 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26901  PyObject* tmp;
26902  if (!value || value == Py_None) {
26903  value = NULL;
26904  } else if (!PyDict_Check(value)) {
26905  PyErr_SetString(PyExc_TypeError,
26906  "__annotations__ must be set to a dict object");
26907  return -1;
26908  }
26909  Py_XINCREF(value);
26910  tmp = op->func_annotations;
26911  op->func_annotations = value;
26912  Py_XDECREF(tmp);
26913  return 0;
26914 }
26915 static PyObject *
26916 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26917  PyObject* result = op->func_annotations;
26918  if (unlikely(!result)) {
26919  result = PyDict_New();
26920  if (unlikely(!result)) return NULL;
26921  op->func_annotations = result;
26922  }
26923  Py_INCREF(result);
26924  return result;
26925 }
26926 static PyGetSetDef __pyx_CyFunction_getsets[] = {
26927  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26928  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26929  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26930  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26931  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
26932  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
26933  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26934  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26935  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26936  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26937  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26938  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26939  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26940  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26941  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26942  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26943  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
26944  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
26945  {0, 0, 0, 0, 0}
26946 };
26947 static PyMemberDef __pyx_CyFunction_members[] = {
26948  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
26949  {0, 0, 0, 0, 0}
26950 };
26951 static PyObject *
26952 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
26953 {
26954 #if PY_MAJOR_VERSION >= 3
26955  return PyUnicode_FromString(m->func.m_ml->ml_name);
26956 #else
26957  return PyString_FromString(m->func.m_ml->ml_name);
26958 #endif
26959 }
26960 static PyMethodDef __pyx_CyFunction_methods[] = {
26961  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26962  {0, 0, 0, 0}
26963 };
26964 #if PY_VERSION_HEX < 0x030500A0
26965 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26966 #else
26967 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26968 #endif
26969 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
26970  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26971  __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
26972  if (op == NULL)
26973  return NULL;
26974  op->flags = flags;
26975  __Pyx_CyFunction_weakreflist(op) = NULL;
26976  op->func.m_ml = ml;
26977  op->func.m_self = (PyObject *) op;
26978  Py_XINCREF(closure);
26979  op->func_closure = closure;
26980  Py_XINCREF(module);
26981  op->func.m_module = module;
26982  op->func_dict = NULL;
26983  op->func_name = NULL;
26984  Py_INCREF(qualname);
26985  op->func_qualname = qualname;
26986  op->func_doc = NULL;
26987  op->func_classobj = NULL;
26988  op->func_globals = globals;
26989  Py_INCREF(op->func_globals);
26990  Py_XINCREF(code);
26991  op->func_code = code;
26992  op->defaults_pyobjects = 0;
26993  op->defaults_size = 0;
26994  op->defaults = NULL;
26995  op->defaults_tuple = NULL;
26996  op->defaults_kwdict = NULL;
26997  op->defaults_getter = NULL;
26998  op->func_annotations = NULL;
26999  PyObject_GC_Track(op);
27000  return (PyObject *) op;
27001 }
27002 static int
27003 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
27004 {
27005  Py_CLEAR(m->func_closure);
27006  Py_CLEAR(m->func.m_module);
27007  Py_CLEAR(m->func_dict);
27008  Py_CLEAR(m->func_name);
27009  Py_CLEAR(m->func_qualname);
27010  Py_CLEAR(m->func_doc);
27011  Py_CLEAR(m->func_globals);
27012  Py_CLEAR(m->func_code);
27013  Py_CLEAR(m->func_classobj);
27014  Py_CLEAR(m->defaults_tuple);
27015  Py_CLEAR(m->defaults_kwdict);
27016  Py_CLEAR(m->func_annotations);
27017  if (m->defaults) {
27018  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
27019  int i;
27020  for (i = 0; i < m->defaults_pyobjects; i++)
27021  Py_XDECREF(pydefaults[i]);
27022  PyObject_Free(m->defaults);
27023  m->defaults = NULL;
27024  }
27025  return 0;
27026 }
27027 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
27028 {
27029  if (__Pyx_CyFunction_weakreflist(m) != NULL)
27030  PyObject_ClearWeakRefs((PyObject *) m);
27031  __Pyx_CyFunction_clear(m);
27032  PyObject_GC_Del(m);
27033 }
27034 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
27035 {
27036  PyObject_GC_UnTrack(m);
27037  __Pyx__CyFunction_dealloc(m);
27038 }
27039 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
27040 {
27041  Py_VISIT(m->func_closure);
27042  Py_VISIT(m->func.m_module);
27043  Py_VISIT(m->func_dict);
27044  Py_VISIT(m->func_name);
27045  Py_VISIT(m->func_qualname);
27046  Py_VISIT(m->func_doc);
27047  Py_VISIT(m->func_globals);
27048  Py_VISIT(m->func_code);
27049  Py_VISIT(m->func_classobj);
27050  Py_VISIT(m->defaults_tuple);
27051  Py_VISIT(m->defaults_kwdict);
27052  if (m->defaults) {
27053  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
27054  int i;
27055  for (i = 0; i < m->defaults_pyobjects; i++)
27056  Py_VISIT(pydefaults[i]);
27057  }
27058  return 0;
27059 }
27060 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
27061 {
27062  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27063  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
27064  Py_INCREF(func);
27065  return func;
27066  }
27067  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
27068  if (type == NULL)
27069  type = (PyObject *)(Py_TYPE(obj));
27070  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
27071  }
27072  if (obj == Py_None)
27073  obj = NULL;
27074  return __Pyx_PyMethod_New(func, obj, type);
27075 }
27076 static PyObject*
27077 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
27078 {
27079 #if PY_MAJOR_VERSION >= 3
27080  return PyUnicode_FromFormat("<cyfunction %U at %p>",
27081  op->func_qualname, (void *)op);
27082 #else
27083  return PyString_FromFormat("<cyfunction %s at %p>",
27084  PyString_AsString(op->func_qualname), (void *)op);
27085 #endif
27086 }
27087 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
27088  PyCFunctionObject* f = (PyCFunctionObject*)func;
27089  PyCFunction meth = f->m_ml->ml_meth;
27090  Py_ssize_t size;
27091  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
27092  case METH_VARARGS:
27093  if (likely(kw == NULL || PyDict_Size(kw) == 0))
27094  return (*meth)(self, arg);
27095  break;
27096  case METH_VARARGS | METH_KEYWORDS:
27097  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
27098  case METH_NOARGS:
27099  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
27100  size = PyTuple_GET_SIZE(arg);
27101  if (likely(size == 0))
27102  return (*meth)(self, NULL);
27103  PyErr_Format(PyExc_TypeError,
27104  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
27105  f->m_ml->ml_name, size);
27106  return NULL;
27107  }
27108  break;
27109  case METH_O:
27110  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
27111  size = PyTuple_GET_SIZE(arg);
27112  if (likely(size == 1)) {
27113  PyObject *result, *arg0;
27114  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27115  arg0 = PyTuple_GET_ITEM(arg, 0);
27116  #else
27117  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
27118  #endif
27119  result = (*meth)(self, arg0);
27120  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
27121  Py_DECREF(arg0);
27122  #endif
27123  return result;
27124  }
27125  PyErr_Format(PyExc_TypeError,
27126  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
27127  f->m_ml->ml_name, size);
27128  return NULL;
27129  }
27130  break;
27131  default:
27132  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
27133  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
27134  "longer supported!");
27135  return NULL;
27136  }
27137  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
27138  f->m_ml->ml_name);
27139  return NULL;
27140 }
27141 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
27142  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
27143 }
27144 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
27145  PyObject *result;
27146  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
27147  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
27148  Py_ssize_t argc;
27149  PyObject *new_args;
27150  PyObject *self;
27151  argc = PyTuple_GET_SIZE(args);
27152  new_args = PyTuple_GetSlice(args, 1, argc);
27153  if (unlikely(!new_args))
27154  return NULL;
27155  self = PyTuple_GetItem(args, 0);
27156  if (unlikely(!self)) {
27157  Py_DECREF(new_args);
27158  return NULL;
27159  }
27160  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
27161  Py_DECREF(new_args);
27162  } else {
27163  result = __Pyx_CyFunction_Call(func, args, kw);
27164  }
27165  return result;
27166 }
27167 static PyTypeObject __pyx_CyFunctionType_type = {
27168  PyVarObject_HEAD_INIT(0, 0)
27169  "cython_function_or_method",
27170  sizeof(__pyx_CyFunctionObject),
27171  0,
27172  (destructor) __Pyx_CyFunction_dealloc,
27173  0,
27174  0,
27175  0,
27176 #if PY_MAJOR_VERSION < 3
27177  0,
27178 #else
27179  0,
27180 #endif
27181  (reprfunc) __Pyx_CyFunction_repr,
27182  0,
27183  0,
27184  0,
27185  0,
27186  __Pyx_CyFunction_CallAsMethod,
27187  0,
27188  0,
27189  0,
27190  0,
27191  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
27192  0,
27193  (traverseproc) __Pyx_CyFunction_traverse,
27194  (inquiry) __Pyx_CyFunction_clear,
27195  0,
27196 #if PY_VERSION_HEX < 0x030500A0
27197  offsetof(__pyx_CyFunctionObject, func_weakreflist),
27198 #else
27199  offsetof(PyCFunctionObject, m_weakreflist),
27200 #endif
27201  0,
27202  0,
27203  __pyx_CyFunction_methods,
27204  __pyx_CyFunction_members,
27205  __pyx_CyFunction_getsets,
27206  0,
27207  0,
27208  __Pyx_CyFunction_descr_get,
27209  0,
27210  offsetof(__pyx_CyFunctionObject, func_dict),
27211  0,
27212  0,
27213  0,
27214  0,
27215  0,
27216  0,
27217  0,
27218  0,
27219  0,
27220  0,
27221  0,
27222  0,
27223 #if PY_VERSION_HEX >= 0x030400a1
27224  0,
27225 #endif
27226 #if PY_VERSION_HEX >= 0x030800b1
27227  0,
27228 #endif
27229 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
27230  0,
27231 #endif
27232 };
27233 static int __pyx_CyFunction_init(void) {
27234  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
27235  if (unlikely(__pyx_CyFunctionType == NULL)) {
27236  return -1;
27237  }
27238  return 0;
27239 }
27240 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
27241  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27242  m->defaults = PyObject_Malloc(size);
27243  if (unlikely(!m->defaults))
27244  return PyErr_NoMemory();
27245  memset(m->defaults, 0, size);
27246  m->defaults_pyobjects = pyobjects;
27247  m->defaults_size = size;
27248  return m->defaults;
27249 }
27250 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
27251  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27252  m->defaults_tuple = tuple;
27253  Py_INCREF(tuple);
27254 }
27255 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
27256  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27257  m->defaults_kwdict = dict;
27258  Py_INCREF(dict);
27259 }
27260 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
27261  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27262  m->func_annotations = dict;
27263  Py_INCREF(dict);
27264 }
27265 
27266 /* Py3ClassCreate */
27267 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
27268  PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
27269  PyObject *ns;
27270  if (metaclass) {
27271  PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
27272  if (prep) {
27273  PyObject *pargs = PyTuple_Pack(2, name, bases);
27274  if (unlikely(!pargs)) {
27275  Py_DECREF(prep);
27276  return NULL;
27277  }
27278  ns = PyObject_Call(prep, pargs, mkw);
27279  Py_DECREF(prep);
27280  Py_DECREF(pargs);
27281  } else {
27282  if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
27283  return NULL;
27284  PyErr_Clear();
27285  ns = PyDict_New();
27286  }
27287  } else {
27288  ns = PyDict_New();
27289  }
27290  if (unlikely(!ns))
27291  return NULL;
27292  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
27293  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
27294  if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
27295  return ns;
27296 bad:
27297  Py_DECREF(ns);
27298  return NULL;
27299 }
27300 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
27301  PyObject *dict, PyObject *mkw,
27302  int calculate_metaclass, int allow_py2_metaclass) {
27303  PyObject *result, *margs;
27304  PyObject *owned_metaclass = NULL;
27305  if (allow_py2_metaclass) {
27306  owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
27307  if (owned_metaclass) {
27308  metaclass = owned_metaclass;
27309  } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
27310  PyErr_Clear();
27311  } else {
27312  return NULL;
27313  }
27314  }
27315  if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
27316  metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
27317  Py_XDECREF(owned_metaclass);
27318  if (unlikely(!metaclass))
27319  return NULL;
27320  owned_metaclass = metaclass;
27321  }
27322  margs = PyTuple_Pack(3, name, bases, dict);
27323  if (unlikely(!margs)) {
27324  result = NULL;
27325  } else {
27326  result = PyObject_Call(metaclass, margs, mkw);
27327  Py_DECREF(margs);
27328  }
27329  Py_XDECREF(owned_metaclass);
27330  return result;
27331 }
27332 
27333 /* CLineInTraceback */
27334 #ifndef CYTHON_CLINE_IN_TRACEBACK
27335 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
27336  PyObject *use_cline;
27337  PyObject *ptype, *pvalue, *ptraceback;
27338 #if CYTHON_COMPILING_IN_CPYTHON
27339  PyObject **cython_runtime_dict;
27340 #endif
27341  if (unlikely(!__pyx_cython_runtime)) {
27342  return c_line;
27343  }
27344  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
27345 #if CYTHON_COMPILING_IN_CPYTHON
27346  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
27347  if (likely(cython_runtime_dict)) {
27348  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
27349  use_cline, *cython_runtime_dict,
27350  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
27351  } else
27352 #endif
27353  {
27354  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
27355  if (use_cline_obj) {
27356  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
27357  Py_DECREF(use_cline_obj);
27358  } else {
27359  PyErr_Clear();
27360  use_cline = NULL;
27361  }
27362  }
27363  if (!use_cline) {
27364  c_line = 0;
27365  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
27366  }
27367  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
27368  c_line = 0;
27369  }
27370  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
27371  return c_line;
27372 }
27373 #endif
27374 
27375 /* CodeObjectCache */
27376 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
27377  int start = 0, mid = 0, end = count - 1;
27378  if (end >= 0 && code_line > entries[end].code_line) {
27379  return count;
27380  }
27381  while (start < end) {
27382  mid = start + (end - start) / 2;
27383  if (code_line < entries[mid].code_line) {
27384  end = mid;
27385  } else if (code_line > entries[mid].code_line) {
27386  start = mid + 1;
27387  } else {
27388  return mid;
27389  }
27390  }
27391  if (code_line <= entries[mid].code_line) {
27392  return mid;
27393  } else {
27394  return mid + 1;
27395  }
27396 }
27397 static PyCodeObject *__pyx_find_code_object(int code_line) {
27398  PyCodeObject* code_object;
27399  int pos;
27400  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
27401  return NULL;
27402  }
27403  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27404  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
27405  return NULL;
27406  }
27407  code_object = __pyx_code_cache.entries[pos].code_object;
27408  Py_INCREF(code_object);
27409  return code_object;
27410 }
27411 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
27412  int pos, i;
27413  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
27414  if (unlikely(!code_line)) {
27415  return;
27416  }
27417  if (unlikely(!entries)) {
27418  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
27419  if (likely(entries)) {
27420  __pyx_code_cache.entries = entries;
27421  __pyx_code_cache.max_count = 64;
27422  __pyx_code_cache.count = 1;
27423  entries[0].code_line = code_line;
27424  entries[0].code_object = code_object;
27425  Py_INCREF(code_object);
27426  }
27427  return;
27428  }
27429  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27430  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
27431  PyCodeObject* tmp = entries[pos].code_object;
27432  entries[pos].code_object = code_object;
27433  Py_DECREF(tmp);
27434  return;
27435  }
27436  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
27437  int new_max = __pyx_code_cache.max_count + 64;
27438  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
27439  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
27440  if (unlikely(!entries)) {
27441  return;
27442  }
27443  __pyx_code_cache.entries = entries;
27444  __pyx_code_cache.max_count = new_max;
27445  }
27446  for (i=__pyx_code_cache.count; i>pos; i--) {
27447  entries[i] = entries[i-1];
27448  }
27449  entries[pos].code_line = code_line;
27450  entries[pos].code_object = code_object;
27451  __pyx_code_cache.count++;
27452  Py_INCREF(code_object);
27453 }
27454 
27455 /* AddTraceback */
27456 #include "compile.h"
27457 #include "frameobject.h"
27458 #include "traceback.h"
27459 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
27460  const char *funcname, int c_line,
27461  int py_line, const char *filename) {
27462  PyCodeObject *py_code = 0;
27463  PyObject *py_srcfile = 0;
27464  PyObject *py_funcname = 0;
27465  #if PY_MAJOR_VERSION < 3
27466  py_srcfile = PyString_FromString(filename);
27467  #else
27468  py_srcfile = PyUnicode_FromString(filename);
27469  #endif
27470  if (!py_srcfile) goto bad;
27471  if (c_line) {
27472  #if PY_MAJOR_VERSION < 3
27473  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27474  #else
27475  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27476  #endif
27477  }
27478  else {
27479  #if PY_MAJOR_VERSION < 3
27480  py_funcname = PyString_FromString(funcname);
27481  #else
27482  py_funcname = PyUnicode_FromString(funcname);
27483  #endif
27484  }
27485  if (!py_funcname) goto bad;
27486  py_code = __Pyx_PyCode_New(
27487  0,
27488  0,
27489  0,
27490  0,
27491  0,
27492  __pyx_empty_bytes, /*PyObject *code,*/
27493  __pyx_empty_tuple, /*PyObject *consts,*/
27494  __pyx_empty_tuple, /*PyObject *names,*/
27495  __pyx_empty_tuple, /*PyObject *varnames,*/
27496  __pyx_empty_tuple, /*PyObject *freevars,*/
27497  __pyx_empty_tuple, /*PyObject *cellvars,*/
27498  py_srcfile, /*PyObject *filename,*/
27499  py_funcname, /*PyObject *name,*/
27500  py_line,
27501  __pyx_empty_bytes /*PyObject *lnotab*/
27502  );
27503  Py_DECREF(py_srcfile);
27504  Py_DECREF(py_funcname);
27505  return py_code;
27506 bad:
27507  Py_XDECREF(py_srcfile);
27508  Py_XDECREF(py_funcname);
27509  return NULL;
27510 }
27511 static void __Pyx_AddTraceback(const char *funcname, int c_line,
27512  int py_line, const char *filename) {
27513  PyCodeObject *py_code = 0;
27514  PyFrameObject *py_frame = 0;
27515  PyThreadState *tstate = __Pyx_PyThreadState_Current;
27516  if (c_line) {
27517  c_line = __Pyx_CLineForTraceback(tstate, c_line);
27518  }
27519  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27520  if (!py_code) {
27521  py_code = __Pyx_CreateCodeObjectForTraceback(
27522  funcname, c_line, py_line, filename);
27523  if (!py_code) goto bad;
27524  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27525  }
27526  py_frame = PyFrame_New(
27527  tstate, /*PyThreadState *tstate,*/
27528  py_code, /*PyCodeObject *code,*/
27529  __pyx_d, /*PyObject *globals,*/
27530  0 /*PyObject *locals*/
27531  );
27532  if (!py_frame) goto bad;
27533  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27534  PyTraceBack_Here(py_frame);
27535 bad:
27536  Py_XDECREF(py_code);
27537  Py_XDECREF(py_frame);
27538 }
27539 
27540 #if PY_MAJOR_VERSION < 3
27541 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
27542  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
27543  if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
27544  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
27545  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
27546  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27547  return -1;
27548 }
27549 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27550  PyObject *obj = view->obj;
27551  if (!obj) return;
27552  if (PyObject_CheckBuffer(obj)) {
27553  PyBuffer_Release(view);
27554  return;
27555  }
27556  if ((0)) {}
27557  else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
27558  view->obj = NULL;
27559  Py_DECREF(obj);
27560 }
27561 #endif
27562 
27563 
27564 /* MemviewSliceIsContig */
27565 static int
27566 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
27567 {
27568  int i, index, step, start;
27569  Py_ssize_t itemsize = mvs.memview->view.itemsize;
27570  if (order == 'F') {
27571  step = 1;
27572  start = 0;
27573  } else {
27574  step = -1;
27575  start = ndim - 1;
27576  }
27577  for (i = 0; i < ndim; i++) {
27578  index = start + step * i;
27579  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27580  return 0;
27581  itemsize *= mvs.shape[index];
27582  }
27583  return 1;
27584 }
27585 
27586 /* OverlappingSlices */
27587 static void
27588 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27589  void **out_start, void **out_end,
27590  int ndim, size_t itemsize)
27591 {
27592  char *start, *end;
27593  int i;
27594  start = end = slice->data;
27595  for (i = 0; i < ndim; i++) {
27596  Py_ssize_t stride = slice->strides[i];
27597  Py_ssize_t extent = slice->shape[i];
27598  if (extent == 0) {
27599  *out_start = *out_end = start;
27600  return;
27601  } else {
27602  if (stride > 0)
27603  end += stride * (extent - 1);
27604  else
27605  start += stride * (extent - 1);
27606  }
27607  }
27608  *out_start = start;
27609  *out_end = end + itemsize;
27610 }
27611 static int
27612 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27613  __Pyx_memviewslice *slice2,
27614  int ndim, size_t itemsize)
27615 {
27616  void *start1, *end1, *start2, *end2;
27617  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27618  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27619  return (start1 < end2) && (start2 < end1);
27620 }
27621 
27622 /* Capsule */
27623 static CYTHON_INLINE PyObject *
27624 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
27625 {
27626  PyObject *cobj;
27627 #if PY_VERSION_HEX >= 0x02070000
27628  cobj = PyCapsule_New(p, sig, NULL);
27629 #else
27630  cobj = PyCObject_FromVoidPtr(p, NULL);
27631 #endif
27632  return cobj;
27633 }
27634 
27635 /* CIntFromPyVerify */
27636 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27637  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27638 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27639  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27640 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27641  {\
27642  func_type value = func_value;\
27643  if (sizeof(target_type) < sizeof(func_type)) {\
27644  if (unlikely(value != (func_type) (target_type) value)) {\
27645  func_type zero = 0;\
27646  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27647  return (target_type) -1;\
27648  if (is_unsigned && unlikely(value < zero))\
27649  goto raise_neg_overflow;\
27650  else\
27651  goto raise_overflow;\
27652  }\
27653  }\
27654  return (target_type) value;\
27655  }
27656 
27657 /* Declarations */
27658 #if CYTHON_CCOMPLEX
27659  #ifdef __cplusplus
27660  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27661  return ::std::complex< float >(x, y);
27662  }
27663  #else
27664  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27665  return x + y*(__pyx_t_float_complex)_Complex_I;
27666  }
27667  #endif
27668 #else
27669  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27670  __pyx_t_float_complex z;
27671  z.real = x;
27672  z.imag = y;
27673  return z;
27674  }
27675 #endif
27676 
27677 /* Arithmetic */
27678 #if CYTHON_CCOMPLEX
27679 #else
27680  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27681  return (a.real == b.real) && (a.imag == b.imag);
27682  }
27683  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27684  __pyx_t_float_complex z;
27685  z.real = a.real + b.real;
27686  z.imag = a.imag + b.imag;
27687  return z;
27688  }
27689  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27690  __pyx_t_float_complex z;
27691  z.real = a.real - b.real;
27692  z.imag = a.imag - b.imag;
27693  return z;
27694  }
27695  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27696  __pyx_t_float_complex z;
27697  z.real = a.real * b.real - a.imag * b.imag;
27698  z.imag = a.real * b.imag + a.imag * b.real;
27699  return z;
27700  }
27701  #if 1
27702  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27703  if (b.imag == 0) {
27704  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27705  } else if (fabsf(b.real) >= fabsf(b.imag)) {
27706  if (b.real == 0 && b.imag == 0) {
27707  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27708  } else {
27709  float r = b.imag / b.real;
27710  float s = (float)(1.0) / (b.real + b.imag * r);
27711  return __pyx_t_float_complex_from_parts(
27712  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27713  }
27714  } else {
27715  float r = b.real / b.imag;
27716  float s = (float)(1.0) / (b.imag + b.real * r);
27717  return __pyx_t_float_complex_from_parts(
27718  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27719  }
27720  }
27721  #else
27722  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27723  if (b.imag == 0) {
27724  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27725  } else {
27726  float denom = b.real * b.real + b.imag * b.imag;
27727  return __pyx_t_float_complex_from_parts(
27728  (a.real * b.real + a.imag * b.imag) / denom,
27729  (a.imag * b.real - a.real * b.imag) / denom);
27730  }
27731  }
27732  #endif
27733  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27734  __pyx_t_float_complex z;
27735  z.real = -a.real;
27736  z.imag = -a.imag;
27737  return z;
27738  }
27739  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27740  return (a.real == 0) && (a.imag == 0);
27741  }
27742  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27743  __pyx_t_float_complex z;
27744  z.real = a.real;
27745  z.imag = -a.imag;
27746  return z;
27747  }
27748  #if 1
27749  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
27750  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27751  return sqrtf(z.real*z.real + z.imag*z.imag);
27752  #else
27753  return hypotf(z.real, z.imag);
27754  #endif
27755  }
27756  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27757  __pyx_t_float_complex z;
27758  float r, lnr, theta, z_r, z_theta;
27759  if (b.imag == 0 && b.real == (int)b.real) {
27760  if (b.real < 0) {
27761  float denom = a.real * a.real + a.imag * a.imag;
27762  a.real = a.real / denom;
27763  a.imag = -a.imag / denom;
27764  b.real = -b.real;
27765  }
27766  switch ((int)b.real) {
27767  case 0:
27768  z.real = 1;
27769  z.imag = 0;
27770  return z;
27771  case 1:
27772  return a;
27773  case 2:
27774  return __Pyx_c_prod_float(a, a);
27775  case 3:
27776  z = __Pyx_c_prod_float(a, a);
27777  return __Pyx_c_prod_float(z, a);
27778  case 4:
27779  z = __Pyx_c_prod_float(a, a);
27780  return __Pyx_c_prod_float(z, z);
27781  }
27782  }
27783  if (a.imag == 0) {
27784  if (a.real == 0) {
27785  return a;
27786  } else if (b.imag == 0) {
27787  z.real = powf(a.real, b.real);
27788  z.imag = 0;
27789  return z;
27790  } else if (a.real > 0) {
27791  r = a.real;
27792  theta = 0;
27793  } else {
27794  r = -a.real;
27795  theta = atan2f(0.0, -1.0);
27796  }
27797  } else {
27798  r = __Pyx_c_abs_float(a);
27799  theta = atan2f(a.imag, a.real);
27800  }
27801  lnr = logf(r);
27802  z_r = expf(lnr * b.real - theta * b.imag);
27803  z_theta = theta * b.real + lnr * b.imag;
27804  z.real = z_r * cosf(z_theta);
27805  z.imag = z_r * sinf(z_theta);
27806  return z;
27807  }
27808  #endif
27809 #endif
27810 
27811 /* Declarations */
27812 #if CYTHON_CCOMPLEX
27813  #ifdef __cplusplus
27814  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27815  return ::std::complex< double >(x, y);
27816  }
27817  #else
27818  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27819  return x + y*(__pyx_t_double_complex)_Complex_I;
27820  }
27821  #endif
27822 #else
27823  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27824  __pyx_t_double_complex z;
27825  z.real = x;
27826  z.imag = y;
27827  return z;
27828  }
27829 #endif
27830 
27831 /* Arithmetic */
27832 #if CYTHON_CCOMPLEX
27833 #else
27834  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27835  return (a.real == b.real) && (a.imag == b.imag);
27836  }
27837  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27838  __pyx_t_double_complex z;
27839  z.real = a.real + b.real;
27840  z.imag = a.imag + b.imag;
27841  return z;
27842  }
27843  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27844  __pyx_t_double_complex z;
27845  z.real = a.real - b.real;
27846  z.imag = a.imag - b.imag;
27847  return z;
27848  }
27849  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27850  __pyx_t_double_complex z;
27851  z.real = a.real * b.real - a.imag * b.imag;
27852  z.imag = a.real * b.imag + a.imag * b.real;
27853  return z;
27854  }
27855  #if 1
27856  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27857  if (b.imag == 0) {
27858  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27859  } else if (fabs(b.real) >= fabs(b.imag)) {
27860  if (b.real == 0 && b.imag == 0) {
27861  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27862  } else {
27863  double r = b.imag / b.real;
27864  double s = (double)(1.0) / (b.real + b.imag * r);
27865  return __pyx_t_double_complex_from_parts(
27866  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27867  }
27868  } else {
27869  double r = b.real / b.imag;
27870  double s = (double)(1.0) / (b.imag + b.real * r);
27871  return __pyx_t_double_complex_from_parts(
27872  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27873  }
27874  }
27875  #else
27876  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27877  if (b.imag == 0) {
27878  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27879  } else {
27880  double denom = b.real * b.real + b.imag * b.imag;
27881  return __pyx_t_double_complex_from_parts(
27882  (a.real * b.real + a.imag * b.imag) / denom,
27883  (a.imag * b.real - a.real * b.imag) / denom);
27884  }
27885  }
27886  #endif
27887  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27888  __pyx_t_double_complex z;
27889  z.real = -a.real;
27890  z.imag = -a.imag;
27891  return z;
27892  }
27893  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27894  return (a.real == 0) && (a.imag == 0);
27895  }
27896  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27897  __pyx_t_double_complex z;
27898  z.real = a.real;
27899  z.imag = -a.imag;
27900  return z;
27901  }
27902  #if 1
27903  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
27904  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27905  return sqrt(z.real*z.real + z.imag*z.imag);
27906  #else
27907  return hypot(z.real, z.imag);
27908  #endif
27909  }
27910  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27911  __pyx_t_double_complex z;
27912  double r, lnr, theta, z_r, z_theta;
27913  if (b.imag == 0 && b.real == (int)b.real) {
27914  if (b.real < 0) {
27915  double denom = a.real * a.real + a.imag * a.imag;
27916  a.real = a.real / denom;
27917  a.imag = -a.imag / denom;
27918  b.real = -b.real;
27919  }
27920  switch ((int)b.real) {
27921  case 0:
27922  z.real = 1;
27923  z.imag = 0;
27924  return z;
27925  case 1:
27926  return a;
27927  case 2:
27928  return __Pyx_c_prod_double(a, a);
27929  case 3:
27930  z = __Pyx_c_prod_double(a, a);
27931  return __Pyx_c_prod_double(z, a);
27932  case 4:
27933  z = __Pyx_c_prod_double(a, a);
27934  return __Pyx_c_prod_double(z, z);
27935  }
27936  }
27937  if (a.imag == 0) {
27938  if (a.real == 0) {
27939  return a;
27940  } else if (b.imag == 0) {
27941  z.real = pow(a.real, b.real);
27942  z.imag = 0;
27943  return z;
27944  } else if (a.real > 0) {
27945  r = a.real;
27946  theta = 0;
27947  } else {
27948  r = -a.real;
27949  theta = atan2(0.0, -1.0);
27950  }
27951  } else {
27952  r = __Pyx_c_abs_double(a);
27953  theta = atan2(a.imag, a.real);
27954  }
27955  lnr = log(r);
27956  z_r = exp(lnr * b.real - theta * b.imag);
27957  z_theta = theta * b.real + lnr * b.imag;
27958  z.real = z_r * cos(z_theta);
27959  z.imag = z_r * sin(z_theta);
27960  return z;
27961  }
27962  #endif
27963 #endif
27964 
27965 /* CIntToPy */
27966 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
27967  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
27968  const int is_unsigned = neg_one > const_zero;
27969  if (is_unsigned) {
27970  if (sizeof(int) < sizeof(long)) {
27971  return PyInt_FromLong((long) value);
27972  } else if (sizeof(int) <= sizeof(unsigned long)) {
27973  return PyLong_FromUnsignedLong((unsigned long) value);
27974 #ifdef HAVE_LONG_LONG
27975  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27976  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27977 #endif
27978  }
27979  } else {
27980  if (sizeof(int) <= sizeof(long)) {
27981  return PyInt_FromLong((long) value);
27982 #ifdef HAVE_LONG_LONG
27983  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27984  return PyLong_FromLongLong((PY_LONG_LONG) value);
27985 #endif
27986  }
27987  }
27988  {
27989  int one = 1; int little = (int)*(unsigned char *)&one;
27990  unsigned char *bytes = (unsigned char *)&value;
27991  return _PyLong_FromByteArray(bytes, sizeof(int),
27992  little, !is_unsigned);
27993  }
27994 }
27995 
27996 /* CIntToPy */
27997 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
27998  const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
27999  const int is_unsigned = neg_one > const_zero;
28000  if (is_unsigned) {
28001  if (sizeof(enum NPY_TYPES) < sizeof(long)) {
28002  return PyInt_FromLong((long) value);
28003  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
28004  return PyLong_FromUnsignedLong((unsigned long) value);
28005 #ifdef HAVE_LONG_LONG
28006  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
28007  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28008 #endif
28009  }
28010  } else {
28011  if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
28012  return PyInt_FromLong((long) value);
28013 #ifdef HAVE_LONG_LONG
28014  } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
28015  return PyLong_FromLongLong((PY_LONG_LONG) value);
28016 #endif
28017  }
28018  }
28019  {
28020  int one = 1; int little = (int)*(unsigned char *)&one;
28021  unsigned char *bytes = (unsigned char *)&value;
28022  return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
28023  little, !is_unsigned);
28024  }
28025 }
28026 
28027 /* MemviewSliceCopyTemplate */
28028 static __Pyx_memviewslice
28029 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
28030  const char *mode, int ndim,
28031  size_t sizeof_dtype, int contig_flag,
28032  int dtype_is_object)
28033 {
28034  __Pyx_RefNannyDeclarations
28035  int i;
28036  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
28037  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
28038  Py_buffer *buf = &from_memview->view;
28039  PyObject *shape_tuple = NULL;
28040  PyObject *temp_int = NULL;
28041  struct __pyx_array_obj *array_obj = NULL;
28042  struct __pyx_memoryview_obj *memview_obj = NULL;
28043  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
28044  for (i = 0; i < ndim; i++) {
28045  if (from_mvs->suboffsets[i] >= 0) {
28046  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
28047  "indirect dimensions (axis %d)", i);
28048  goto fail;
28049  }
28050  }
28051  shape_tuple = PyTuple_New(ndim);
28052  if (unlikely(!shape_tuple)) {
28053  goto fail;
28054  }
28055  __Pyx_GOTREF(shape_tuple);
28056  for(i = 0; i < ndim; i++) {
28057  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
28058  if(unlikely(!temp_int)) {
28059  goto fail;
28060  } else {
28061  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
28062  temp_int = NULL;
28063  }
28064  }
28065  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
28066  if (unlikely(!array_obj)) {
28067  goto fail;
28068  }
28069  __Pyx_GOTREF(array_obj);
28070  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28071  (PyObject *) array_obj, contig_flag,
28072  dtype_is_object,
28073  from_mvs->memview->typeinfo);
28074  if (unlikely(!memview_obj))
28075  goto fail;
28076  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
28077  goto fail;
28078  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
28079  dtype_is_object) < 0))
28080  goto fail;
28081  goto no_fail;
28082 fail:
28083  __Pyx_XDECREF(new_mvs.memview);
28084  new_mvs.memview = NULL;
28085  new_mvs.data = NULL;
28086 no_fail:
28087  __Pyx_XDECREF(shape_tuple);
28088  __Pyx_XDECREF(temp_int);
28089  __Pyx_XDECREF(array_obj);
28090  __Pyx_RefNannyFinishContext();
28091  return new_mvs;
28092 }
28093 
28094 /* CIntFromPy */
28095 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
28096  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
28097  const int is_unsigned = neg_one > const_zero;
28098 #if PY_MAJOR_VERSION < 3
28099  if (likely(PyInt_Check(x))) {
28100  if (sizeof(int) < sizeof(long)) {
28101  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
28102  } else {
28103  long val = PyInt_AS_LONG(x);
28104  if (is_unsigned && unlikely(val < 0)) {
28105  goto raise_neg_overflow;
28106  }
28107  return (int) val;
28108  }
28109  } else
28110 #endif
28111  if (likely(PyLong_Check(x))) {
28112  if (is_unsigned) {
28113 #if CYTHON_USE_PYLONG_INTERNALS
28114  const digit* digits = ((PyLongObject*)x)->ob_digit;
28115  switch (Py_SIZE(x)) {
28116  case 0: return (int) 0;
28117  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
28118  case 2:
28119  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
28120  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28121  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28122  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
28123  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28124  }
28125  }
28126  break;
28127  case 3:
28128  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28129  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28130  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28131  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
28132  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28133  }
28134  }
28135  break;
28136  case 4:
28137  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28138  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28139  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28140  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
28141  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28142  }
28143  }
28144  break;
28145  }
28146 #endif
28147 #if CYTHON_COMPILING_IN_CPYTHON
28148  if (unlikely(Py_SIZE(x) < 0)) {
28149  goto raise_neg_overflow;
28150  }
28151 #else
28152  {
28153  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28154  if (unlikely(result < 0))
28155  return (int) -1;
28156  if (unlikely(result == 1))
28157  goto raise_neg_overflow;
28158  }
28159 #endif
28160  if (sizeof(int) <= sizeof(unsigned long)) {
28161  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
28162 #ifdef HAVE_LONG_LONG
28163  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28164  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28165 #endif
28166  }
28167  } else {
28168 #if CYTHON_USE_PYLONG_INTERNALS
28169  const digit* digits = ((PyLongObject*)x)->ob_digit;
28170  switch (Py_SIZE(x)) {
28171  case 0: return (int) 0;
28172  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
28173  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
28174  case -2:
28175  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
28176  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28177  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28178  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28179  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28180  }
28181  }
28182  break;
28183  case 2:
28184  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
28185  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28186  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28187  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28188  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28189  }
28190  }
28191  break;
28192  case -3:
28193  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28194  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28195  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28196  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28197  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28198  }
28199  }
28200  break;
28201  case 3:
28202  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28203  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28204  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28205  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28206  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28207  }
28208  }
28209  break;
28210  case -4:
28211  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28212  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28213  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28214  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28215  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28216  }
28217  }
28218  break;
28219  case 4:
28220  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28221  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28222  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28223  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28224  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28225  }
28226  }
28227  break;
28228  }
28229 #endif
28230  if (sizeof(int) <= sizeof(long)) {
28231  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
28232 #ifdef HAVE_LONG_LONG
28233  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28234  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
28235 #endif
28236  }
28237  }
28238  {
28239 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28240  PyErr_SetString(PyExc_RuntimeError,
28241  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28242 #else
28243  int val;
28244  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28245  #if PY_MAJOR_VERSION < 3
28246  if (likely(v) && !PyLong_Check(v)) {
28247  PyObject *tmp = v;
28248  v = PyNumber_Long(tmp);
28249  Py_DECREF(tmp);
28250  }
28251  #endif
28252  if (likely(v)) {
28253  int one = 1; int is_little = (int)*(unsigned char *)&one;
28254  unsigned char *bytes = (unsigned char *)&val;
28255  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28256  bytes, sizeof(val),
28257  is_little, !is_unsigned);
28258  Py_DECREF(v);
28259  if (likely(!ret))
28260  return val;
28261  }
28262 #endif
28263  return (int) -1;
28264  }
28265  } else {
28266  int val;
28267  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28268  if (!tmp) return (int) -1;
28269  val = __Pyx_PyInt_As_int(tmp);
28270  Py_DECREF(tmp);
28271  return val;
28272  }
28273 raise_overflow:
28274  PyErr_SetString(PyExc_OverflowError,
28275  "value too large to convert to int");
28276  return (int) -1;
28277 raise_neg_overflow:
28278  PyErr_SetString(PyExc_OverflowError,
28279  "can't convert negative value to int");
28280  return (int) -1;
28281 }
28282 
28283 /* CIntFromPy */
28284 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
28285  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
28286  const int is_unsigned = neg_one > const_zero;
28287 #if PY_MAJOR_VERSION < 3
28288  if (likely(PyInt_Check(x))) {
28289  if (sizeof(long) < sizeof(long)) {
28290  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
28291  } else {
28292  long val = PyInt_AS_LONG(x);
28293  if (is_unsigned && unlikely(val < 0)) {
28294  goto raise_neg_overflow;
28295  }
28296  return (long) val;
28297  }
28298  } else
28299 #endif
28300  if (likely(PyLong_Check(x))) {
28301  if (is_unsigned) {
28302 #if CYTHON_USE_PYLONG_INTERNALS
28303  const digit* digits = ((PyLongObject*)x)->ob_digit;
28304  switch (Py_SIZE(x)) {
28305  case 0: return (long) 0;
28306  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
28307  case 2:
28308  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28309  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28310  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28311  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
28312  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28313  }
28314  }
28315  break;
28316  case 3:
28317  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28318  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28319  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28320  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
28321  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28322  }
28323  }
28324  break;
28325  case 4:
28326  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28327  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28328  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28329  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
28330  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28331  }
28332  }
28333  break;
28334  }
28335 #endif
28336 #if CYTHON_COMPILING_IN_CPYTHON
28337  if (unlikely(Py_SIZE(x) < 0)) {
28338  goto raise_neg_overflow;
28339  }
28340 #else
28341  {
28342  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28343  if (unlikely(result < 0))
28344  return (long) -1;
28345  if (unlikely(result == 1))
28346  goto raise_neg_overflow;
28347  }
28348 #endif
28349  if (sizeof(long) <= sizeof(unsigned long)) {
28350  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
28351 #ifdef HAVE_LONG_LONG
28352  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28353  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28354 #endif
28355  }
28356  } else {
28357 #if CYTHON_USE_PYLONG_INTERNALS
28358  const digit* digits = ((PyLongObject*)x)->ob_digit;
28359  switch (Py_SIZE(x)) {
28360  case 0: return (long) 0;
28361  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
28362  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
28363  case -2:
28364  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
28365  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28366  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28367  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28368  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28369  }
28370  }
28371  break;
28372  case 2:
28373  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28374  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28375  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28376  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28377  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28378  }
28379  }
28380  break;
28381  case -3:
28382  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28383  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28384  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28385  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28386  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28387  }
28388  }
28389  break;
28390  case 3:
28391  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28392  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28393  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28394  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28395  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28396  }
28397  }
28398  break;
28399  case -4:
28400  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28401  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28402  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28403  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28404  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28405  }
28406  }
28407  break;
28408  case 4:
28409  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28410  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28411  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28412  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28413  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28414  }
28415  }
28416  break;
28417  }
28418 #endif
28419  if (sizeof(long) <= sizeof(long)) {
28420  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
28421 #ifdef HAVE_LONG_LONG
28422  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28423  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
28424 #endif
28425  }
28426  }
28427  {
28428 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28429  PyErr_SetString(PyExc_RuntimeError,
28430  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28431 #else
28432  long val;
28433  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28434  #if PY_MAJOR_VERSION < 3
28435  if (likely(v) && !PyLong_Check(v)) {
28436  PyObject *tmp = v;
28437  v = PyNumber_Long(tmp);
28438  Py_DECREF(tmp);
28439  }
28440  #endif
28441  if (likely(v)) {
28442  int one = 1; int is_little = (int)*(unsigned char *)&one;
28443  unsigned char *bytes = (unsigned char *)&val;
28444  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28445  bytes, sizeof(val),
28446  is_little, !is_unsigned);
28447  Py_DECREF(v);
28448  if (likely(!ret))
28449  return val;
28450  }
28451 #endif
28452  return (long) -1;
28453  }
28454  } else {
28455  long val;
28456  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28457  if (!tmp) return (long) -1;
28458  val = __Pyx_PyInt_As_long(tmp);
28459  Py_DECREF(tmp);
28460  return val;
28461  }
28462 raise_overflow:
28463  PyErr_SetString(PyExc_OverflowError,
28464  "value too large to convert to long");
28465  return (long) -1;
28466 raise_neg_overflow:
28467  PyErr_SetString(PyExc_OverflowError,
28468  "can't convert negative value to long");
28469  return (long) -1;
28470 }
28471 
28472 /* CIntToPy */
28473 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
28474  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
28475  const int is_unsigned = neg_one > const_zero;
28476  if (is_unsigned) {
28477  if (sizeof(long) < sizeof(long)) {
28478  return PyInt_FromLong((long) value);
28479  } else if (sizeof(long) <= sizeof(unsigned long)) {
28480  return PyLong_FromUnsignedLong((unsigned long) value);
28481 #ifdef HAVE_LONG_LONG
28482  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28483  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28484 #endif
28485  }
28486  } else {
28487  if (sizeof(long) <= sizeof(long)) {
28488  return PyInt_FromLong((long) value);
28489 #ifdef HAVE_LONG_LONG
28490  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28491  return PyLong_FromLongLong((PY_LONG_LONG) value);
28492 #endif
28493  }
28494  }
28495  {
28496  int one = 1; int little = (int)*(unsigned char *)&one;
28497  unsigned char *bytes = (unsigned char *)&value;
28498  return _PyLong_FromByteArray(bytes, sizeof(long),
28499  little, !is_unsigned);
28500  }
28501 }
28502 
28503 /* CIntFromPy */
28504 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
28505  const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
28506  const int is_unsigned = neg_one > const_zero;
28507 #if PY_MAJOR_VERSION < 3
28508  if (likely(PyInt_Check(x))) {
28509  if (sizeof(char) < sizeof(long)) {
28510  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
28511  } else {
28512  long val = PyInt_AS_LONG(x);
28513  if (is_unsigned && unlikely(val < 0)) {
28514  goto raise_neg_overflow;
28515  }
28516  return (char) val;
28517  }
28518  } else
28519 #endif
28520  if (likely(PyLong_Check(x))) {
28521  if (is_unsigned) {
28522 #if CYTHON_USE_PYLONG_INTERNALS
28523  const digit* digits = ((PyLongObject*)x)->ob_digit;
28524  switch (Py_SIZE(x)) {
28525  case 0: return (char) 0;
28526  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
28527  case 2:
28528  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28529  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28530  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28531  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
28532  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28533  }
28534  }
28535  break;
28536  case 3:
28537  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28538  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28539  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28540  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
28541  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28542  }
28543  }
28544  break;
28545  case 4:
28546  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28547  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28548  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28549  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
28550  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28551  }
28552  }
28553  break;
28554  }
28555 #endif
28556 #if CYTHON_COMPILING_IN_CPYTHON
28557  if (unlikely(Py_SIZE(x) < 0)) {
28558  goto raise_neg_overflow;
28559  }
28560 #else
28561  {
28562  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28563  if (unlikely(result < 0))
28564  return (char) -1;
28565  if (unlikely(result == 1))
28566  goto raise_neg_overflow;
28567  }
28568 #endif
28569  if (sizeof(char) <= sizeof(unsigned long)) {
28570  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
28571 #ifdef HAVE_LONG_LONG
28572  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
28573  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28574 #endif
28575  }
28576  } else {
28577 #if CYTHON_USE_PYLONG_INTERNALS
28578  const digit* digits = ((PyLongObject*)x)->ob_digit;
28579  switch (Py_SIZE(x)) {
28580  case 0: return (char) 0;
28581  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
28582  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
28583  case -2:
28584  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
28585  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28586  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28587  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28588  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28589  }
28590  }
28591  break;
28592  case 2:
28593  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28594  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28595  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28596  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28597  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28598  }
28599  }
28600  break;
28601  case -3:
28602  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28603  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28604  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28605  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28606  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28607  }
28608  }
28609  break;
28610  case 3:
28611  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28612  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28613  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28614  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28615  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28616  }
28617  }
28618  break;
28619  case -4:
28620  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28621  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28622  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28623  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28624  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28625  }
28626  }
28627  break;
28628  case 4:
28629  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28630  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28631  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28632  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28633  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28634  }
28635  }
28636  break;
28637  }
28638 #endif
28639  if (sizeof(char) <= sizeof(long)) {
28640  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
28641 #ifdef HAVE_LONG_LONG
28642  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
28643  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
28644 #endif
28645  }
28646  }
28647  {
28648 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28649  PyErr_SetString(PyExc_RuntimeError,
28650  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28651 #else
28652  char val;
28653  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28654  #if PY_MAJOR_VERSION < 3
28655  if (likely(v) && !PyLong_Check(v)) {
28656  PyObject *tmp = v;
28657  v = PyNumber_Long(tmp);
28658  Py_DECREF(tmp);
28659  }
28660  #endif
28661  if (likely(v)) {
28662  int one = 1; int is_little = (int)*(unsigned char *)&one;
28663  unsigned char *bytes = (unsigned char *)&val;
28664  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28665  bytes, sizeof(val),
28666  is_little, !is_unsigned);
28667  Py_DECREF(v);
28668  if (likely(!ret))
28669  return val;
28670  }
28671 #endif
28672  return (char) -1;
28673  }
28674  } else {
28675  char val;
28676  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28677  if (!tmp) return (char) -1;
28678  val = __Pyx_PyInt_As_char(tmp);
28679  Py_DECREF(tmp);
28680  return val;
28681  }
28682 raise_overflow:
28683  PyErr_SetString(PyExc_OverflowError,
28684  "value too large to convert to char");
28685  return (char) -1;
28686 raise_neg_overflow:
28687  PyErr_SetString(PyExc_OverflowError,
28688  "can't convert negative value to char");
28689  return (char) -1;
28690 }
28691 
28692 /* IsLittleEndian */
28693 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
28694 {
28695  union {
28696  uint32_t u32;
28697  uint8_t u8[4];
28698  } S;
28699  S.u32 = 0x01020304;
28700  return S.u8[0] == 4;
28701 }
28702 
28703 /* BufferFormatCheck */
28704 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
28705  __Pyx_BufFmt_StackElem* stack,
28706  __Pyx_TypeInfo* type) {
28707  stack[0].field = &ctx->root;
28708  stack[0].parent_offset = 0;
28709  ctx->root.type = type;
28710  ctx->root.name = "buffer dtype";
28711  ctx->root.offset = 0;
28712  ctx->head = stack;
28713  ctx->head->field = &ctx->root;
28714  ctx->fmt_offset = 0;
28715  ctx->head->parent_offset = 0;
28716  ctx->new_packmode = '@';
28717  ctx->enc_packmode = '@';
28718  ctx->new_count = 1;
28719  ctx->enc_count = 0;
28720  ctx->enc_type = 0;
28721  ctx->is_complex = 0;
28722  ctx->is_valid_array = 0;
28723  ctx->struct_alignment = 0;
28724  while (type->typegroup == 'S') {
28725  ++ctx->head;
28726  ctx->head->field = type->fields;
28727  ctx->head->parent_offset = 0;
28728  type = type->fields->type;
28729  }
28730 }
28731 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
28732  int count;
28733  const char* t = *ts;
28734  if (*t < '0' || *t > '9') {
28735  return -1;
28736  } else {
28737  count = *t++ - '0';
28738  while (*t >= '0' && *t <= '9') {
28739  count *= 10;
28740  count += *t++ - '0';
28741  }
28742  }
28743  *ts = t;
28744  return count;
28745 }
28746 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
28747  int number = __Pyx_BufFmt_ParseNumber(ts);
28748  if (number == -1)
28749  PyErr_Format(PyExc_ValueError,\
28750  "Does not understand character buffer dtype format string ('%c')", **ts);
28751  return number;
28752 }
28753 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
28754  PyErr_Format(PyExc_ValueError,
28755  "Unexpected format string character: '%c'", ch);
28756 }
28757 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
28758  switch (ch) {
28759  case '?': return "'bool'";
28760  case 'c': return "'char'";
28761  case 'b': return "'signed char'";
28762  case 'B': return "'unsigned char'";
28763  case 'h': return "'short'";
28764  case 'H': return "'unsigned short'";
28765  case 'i': return "'int'";
28766  case 'I': return "'unsigned int'";
28767  case 'l': return "'long'";
28768  case 'L': return "'unsigned long'";
28769  case 'q': return "'long long'";
28770  case 'Q': return "'unsigned long long'";
28771  case 'f': return (is_complex ? "'complex float'" : "'float'");
28772  case 'd': return (is_complex ? "'complex double'" : "'double'");
28773  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
28774  case 'T': return "a struct";
28775  case 'O': return "Python object";
28776  case 'P': return "a pointer";
28777  case 's': case 'p': return "a string";
28778  case 0: return "end";
28779  default: return "unparseable format string";
28780  }
28781 }
28782 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
28783  switch (ch) {
28784  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28785  case 'h': case 'H': return 2;
28786  case 'i': case 'I': case 'l': case 'L': return 4;
28787  case 'q': case 'Q': return 8;
28788  case 'f': return (is_complex ? 8 : 4);
28789  case 'd': return (is_complex ? 16 : 8);
28790  case 'g': {
28791  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
28792  return 0;
28793  }
28794  case 'O': case 'P': return sizeof(void*);
28795  default:
28796  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28797  return 0;
28798  }
28799 }
28800 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
28801  switch (ch) {
28802  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28803  case 'h': case 'H': return sizeof(short);
28804  case 'i': case 'I': return sizeof(int);
28805  case 'l': case 'L': return sizeof(long);
28806  #ifdef HAVE_LONG_LONG
28807  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
28808  #endif
28809  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
28810  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
28811  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
28812  case 'O': case 'P': return sizeof(void*);
28813  default: {
28814  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28815  return 0;
28816  }
28817  }
28818 }
28819 typedef struct { char c; short x; } __Pyx_st_short;
28820 typedef struct { char c; int x; } __Pyx_st_int;
28821 typedef struct { char c; long x; } __Pyx_st_long;
28822 typedef struct { char c; float x; } __Pyx_st_float;
28823 typedef struct { char c; double x; } __Pyx_st_double;
28824 typedef struct { char c; long double x; } __Pyx_st_longdouble;
28825 typedef struct { char c; void *x; } __Pyx_st_void_p;
28826 #ifdef HAVE_LONG_LONG
28827 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
28828 #endif
28829 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
28830  switch (ch) {
28831  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28832  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
28833  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
28834  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
28835 #ifdef HAVE_LONG_LONG
28836  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
28837 #endif
28838  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
28839  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
28840  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
28841  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
28842  default:
28843  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28844  return 0;
28845  }
28846 }
28847 /* These are for computing the padding at the end of the struct to align
28848  on the first member of the struct. This will probably the same as above,
28849  but we don't have any guarantees.
28850  */
28851 typedef struct { short x; char c; } __Pyx_pad_short;
28852 typedef struct { int x; char c; } __Pyx_pad_int;
28853 typedef struct { long x; char c; } __Pyx_pad_long;
28854 typedef struct { float x; char c; } __Pyx_pad_float;
28855 typedef struct { double x; char c; } __Pyx_pad_double;
28856 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
28857 typedef struct { void *x; char c; } __Pyx_pad_void_p;
28858 #ifdef HAVE_LONG_LONG
28859 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
28860 #endif
28861 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
28862  switch (ch) {
28863  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28864  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
28865  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
28866  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
28867 #ifdef HAVE_LONG_LONG
28868  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
28869 #endif
28870  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
28871  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
28872  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
28873  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
28874  default:
28875  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28876  return 0;
28877  }
28878 }
28879 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
28880  switch (ch) {
28881  case 'c':
28882  return 'H';
28883  case 'b': case 'h': case 'i':
28884  case 'l': case 'q': case 's': case 'p':
28885  return 'I';
28886  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
28887  return 'U';
28888  case 'f': case 'd': case 'g':
28889  return (is_complex ? 'C' : 'R');
28890  case 'O':
28891  return 'O';
28892  case 'P':
28893  return 'P';
28894  default: {
28895  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28896  return 0;
28897  }
28898  }
28899 }
28900 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
28901  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
28902  const char* expected;
28903  const char* quote;
28904  if (ctx->head == NULL) {
28905  expected = "end";
28906  quote = "";
28907  } else {
28908  expected = ctx->head->field->type->name;
28909  quote = "'";
28910  }
28911  PyErr_Format(PyExc_ValueError,
28912  "Buffer dtype mismatch, expected %s%s%s but got %s",
28913  quote, expected, quote,
28914  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
28915  } else {
28916  __Pyx_StructField* field = ctx->head->field;
28917  __Pyx_StructField* parent = (ctx->head - 1)->field;
28918  PyErr_Format(PyExc_ValueError,
28919  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
28920  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
28921  parent->type->name, field->name);
28922  }
28923 }
28924 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
28925  char group;
28926  size_t size, offset, arraysize = 1;
28927  if (ctx->enc_type == 0) return 0;
28928  if (ctx->head->field->type->arraysize[0]) {
28929  int i, ndim = 0;
28930  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
28931  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
28932  ndim = 1;
28933  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
28934  PyErr_Format(PyExc_ValueError,
28935  "Expected a dimension of size %zu, got %zu",
28936  ctx->head->field->type->arraysize[0], ctx->enc_count);
28937  return -1;
28938  }
28939  }
28940  if (!ctx->is_valid_array) {
28941  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
28942  ctx->head->field->type->ndim, ndim);
28943  return -1;
28944  }
28945  for (i = 0; i < ctx->head->field->type->ndim; i++) {
28946  arraysize *= ctx->head->field->type->arraysize[i];
28947  }
28948  ctx->is_valid_array = 0;
28949  ctx->enc_count = 1;
28950  }
28951  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
28952  do {
28953  __Pyx_StructField* field = ctx->head->field;
28954  __Pyx_TypeInfo* type = field->type;
28955  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
28956  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
28957  } else {
28958  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
28959  }
28960  if (ctx->enc_packmode == '@') {
28961  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
28962  size_t align_mod_offset;
28963  if (align_at == 0) return -1;
28964  align_mod_offset = ctx->fmt_offset % align_at;
28965  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
28966  if (ctx->struct_alignment == 0)
28967  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
28968  ctx->is_complex);
28969  }
28970  if (type->size != size || type->typegroup != group) {
28971  if (type->typegroup == 'C' && type->fields != NULL) {
28972  size_t parent_offset = ctx->head->parent_offset + field->offset;
28973  ++ctx->head;
28974  ctx->head->field = type->fields;
28975  ctx->head->parent_offset = parent_offset;
28976  continue;
28977  }
28978  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
28979  } else {
28980  __Pyx_BufFmt_RaiseExpected(ctx);
28981  return -1;
28982  }
28983  }
28984  offset = ctx->head->parent_offset + field->offset;
28985  if (ctx->fmt_offset != offset) {
28986  PyErr_Format(PyExc_ValueError,
28987  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
28988  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
28989  return -1;
28990  }
28991  ctx->fmt_offset += size;
28992  if (arraysize)
28993  ctx->fmt_offset += (arraysize - 1) * size;
28994  --ctx->enc_count;
28995  while (1) {
28996  if (field == &ctx->root) {
28997  ctx->head = NULL;
28998  if (ctx->enc_count != 0) {
28999  __Pyx_BufFmt_RaiseExpected(ctx);
29000  return -1;
29001  }
29002  break;
29003  }
29004  ctx->head->field = ++field;
29005  if (field->type == NULL) {
29006  --ctx->head;
29007  field = ctx->head->field;
29008  continue;
29009  } else if (field->type->typegroup == 'S') {
29010  size_t parent_offset = ctx->head->parent_offset + field->offset;
29011  if (field->type->fields->type == NULL) continue;
29012  field = field->type->fields;
29013  ++ctx->head;
29014  ctx->head->field = field;
29015  ctx->head->parent_offset = parent_offset;
29016  break;
29017  } else {
29018  break;
29019  }
29020  }
29021  } while (ctx->enc_count);
29022  ctx->enc_type = 0;
29023  ctx->is_complex = 0;
29024  return 0;
29025 }
29026 static PyObject *
29027 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
29028 {
29029  const char *ts = *tsp;
29030  int i = 0, number;
29031  int ndim = ctx->head->field->type->ndim;
29032 ;
29033  ++ts;
29034  if (ctx->new_count != 1) {
29035  PyErr_SetString(PyExc_ValueError,
29036  "Cannot handle repeated arrays in format string");
29037  return NULL;
29038  }
29039  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29040  while (*ts && *ts != ')') {
29041  switch (*ts) {
29042  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
29043  default: break;
29044  }
29045  number = __Pyx_BufFmt_ExpectNumber(&ts);
29046  if (number == -1) return NULL;
29047  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
29048  return PyErr_Format(PyExc_ValueError,
29049  "Expected a dimension of size %zu, got %d",
29050  ctx->head->field->type->arraysize[i], number);
29051  if (*ts != ',' && *ts != ')')
29052  return PyErr_Format(PyExc_ValueError,
29053  "Expected a comma in format string, got '%c'", *ts);
29054  if (*ts == ',') ts++;
29055  i++;
29056  }
29057  if (i != ndim)
29058  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
29059  ctx->head->field->type->ndim, i);
29060  if (!*ts) {
29061  PyErr_SetString(PyExc_ValueError,
29062  "Unexpected end of format string, expected ')'");
29063  return NULL;
29064  }
29065  ctx->is_valid_array = 1;
29066  ctx->new_count = 1;
29067  *tsp = ++ts;
29068  return Py_None;
29069 }
29070 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
29071  int got_Z = 0;
29072  while (1) {
29073  switch(*ts) {
29074  case 0:
29075  if (ctx->enc_type != 0 && ctx->head == NULL) {
29076  __Pyx_BufFmt_RaiseExpected(ctx);
29077  return NULL;
29078  }
29079  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29080  if (ctx->head != NULL) {
29081  __Pyx_BufFmt_RaiseExpected(ctx);
29082  return NULL;
29083  }
29084  return ts;
29085  case ' ':
29086  case '\r':
29087  case '\n':
29088  ++ts;
29089  break;
29090  case '<':
29091  if (!__Pyx_Is_Little_Endian()) {
29092  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
29093  return NULL;
29094  }
29095  ctx->new_packmode = '=';
29096  ++ts;
29097  break;
29098  case '>':
29099  case '!':
29100  if (__Pyx_Is_Little_Endian()) {
29101  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
29102  return NULL;
29103  }
29104  ctx->new_packmode = '=';
29105  ++ts;
29106  break;
29107  case '=':
29108  case '@':
29109  case '^':
29110  ctx->new_packmode = *ts++;
29111  break;
29112  case 'T':
29113  {
29114  const char* ts_after_sub;
29115  size_t i, struct_count = ctx->new_count;
29116  size_t struct_alignment = ctx->struct_alignment;
29117  ctx->new_count = 1;
29118  ++ts;
29119  if (*ts != '{') {
29120  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
29121  return NULL;
29122  }
29123  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29124  ctx->enc_type = 0;
29125  ctx->enc_count = 0;
29126  ctx->struct_alignment = 0;
29127  ++ts;
29128  ts_after_sub = ts;
29129  for (i = 0; i != struct_count; ++i) {
29130  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
29131  if (!ts_after_sub) return NULL;
29132  }
29133  ts = ts_after_sub;
29134  if (struct_alignment) ctx->struct_alignment = struct_alignment;
29135  }
29136  break;
29137  case '}':
29138  {
29139  size_t alignment = ctx->struct_alignment;
29140  ++ts;
29141  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29142  ctx->enc_type = 0;
29143  if (alignment && ctx->fmt_offset % alignment) {
29144  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
29145  }
29146  }
29147  return ts;
29148  case 'x':
29149  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29150  ctx->fmt_offset += ctx->new_count;
29151  ctx->new_count = 1;
29152  ctx->enc_count = 0;
29153  ctx->enc_type = 0;
29154  ctx->enc_packmode = ctx->new_packmode;
29155  ++ts;
29156  break;
29157  case 'Z':
29158  got_Z = 1;
29159  ++ts;
29160  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
29161  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
29162  return NULL;
29163  }
29164  CYTHON_FALLTHROUGH;
29165  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
29166  case 'l': case 'L': case 'q': case 'Q':
29167  case 'f': case 'd': case 'g':
29168  case 'O': case 'p':
29169  if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
29170  ctx->enc_packmode == ctx->new_packmode) {
29171  ctx->enc_count += ctx->new_count;
29172  ctx->new_count = 1;
29173  got_Z = 0;
29174  ++ts;
29175  break;
29176  }
29177  CYTHON_FALLTHROUGH;
29178  case 's':
29179  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29180  ctx->enc_count = ctx->new_count;
29181  ctx->enc_packmode = ctx->new_packmode;
29182  ctx->enc_type = *ts;
29183  ctx->is_complex = got_Z;
29184  ++ts;
29185  ctx->new_count = 1;
29186  got_Z = 0;
29187  break;
29188  case ':':
29189  ++ts;
29190  while(*ts != ':') ++ts;
29191  ++ts;
29192  break;
29193  case '(':
29194  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
29195  break;
29196  default:
29197  {
29198  int number = __Pyx_BufFmt_ExpectNumber(&ts);
29199  if (number == -1) return NULL;
29200  ctx->new_count = (size_t)number;
29201  }
29202  }
29203  }
29204 }
29205 
29206 /* TypeInfoCompare */
29207  static int
29208 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
29209 {
29210  int i;
29211  if (!a || !b)
29212  return 0;
29213  if (a == b)
29214  return 1;
29215  if (a->size != b->size || a->typegroup != b->typegroup ||
29216  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
29217  if (a->typegroup == 'H' || b->typegroup == 'H') {
29218  return a->size == b->size;
29219  } else {
29220  return 0;
29221  }
29222  }
29223  if (a->ndim) {
29224  for (i = 0; i < a->ndim; i++)
29225  if (a->arraysize[i] != b->arraysize[i])
29226  return 0;
29227  }
29228  if (a->typegroup == 'S') {
29229  if (a->flags != b->flags)
29230  return 0;
29231  if (a->fields || b->fields) {
29232  if (!(a->fields && b->fields))
29233  return 0;
29234  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
29235  __Pyx_StructField *field_a = a->fields + i;
29236  __Pyx_StructField *field_b = b->fields + i;
29237  if (field_a->offset != field_b->offset ||
29238  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
29239  return 0;
29240  }
29241  return !a->fields[i].type && !b->fields[i].type;
29242  }
29243  }
29244  return 1;
29245 }
29246 
29247 /* MemviewSliceValidateAndInit */
29248  static int
29249 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
29250 {
29251  if (buf->shape[dim] <= 1)
29252  return 1;
29253  if (buf->strides) {
29254  if (spec & __Pyx_MEMVIEW_CONTIG) {
29255  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
29256  if (buf->strides[dim] != sizeof(void *)) {
29257  PyErr_Format(PyExc_ValueError,
29258  "Buffer is not indirectly contiguous "
29259  "in dimension %d.", dim);
29260  goto fail;
29261  }
29262  } else if (buf->strides[dim] != buf->itemsize) {
29263  PyErr_SetString(PyExc_ValueError,
29264  "Buffer and memoryview are not contiguous "
29265  "in the same dimension.");
29266  goto fail;
29267  }
29268  }
29269  if (spec & __Pyx_MEMVIEW_FOLLOW) {
29270  Py_ssize_t stride = buf->strides[dim];
29271  if (stride < 0)
29272  stride = -stride;
29273  if (stride < buf->itemsize) {
29274  PyErr_SetString(PyExc_ValueError,
29275  "Buffer and memoryview are not contiguous "
29276  "in the same dimension.");
29277  goto fail;
29278  }
29279  }
29280  } else {
29281  if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
29282  PyErr_Format(PyExc_ValueError,
29283  "C-contiguous buffer is not contiguous in "
29284  "dimension %d", dim);
29285  goto fail;
29286  } else if (spec & (__Pyx_MEMVIEW_PTR)) {
29287  PyErr_Format(PyExc_ValueError,
29288  "C-contiguous buffer is not indirect in "
29289  "dimension %d", dim);
29290  goto fail;
29291  } else if (buf->suboffsets) {
29292  PyErr_SetString(PyExc_ValueError,
29293  "Buffer exposes suboffsets but no strides");
29294  goto fail;
29295  }
29296  }
29297  return 1;
29298 fail:
29299  return 0;
29300 }
29301 static int
29302 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
29303 {
29304  if (spec & __Pyx_MEMVIEW_DIRECT) {
29305  if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
29306  PyErr_Format(PyExc_ValueError,
29307  "Buffer not compatible with direct access "
29308  "in dimension %d.", dim);
29309  goto fail;
29310  }
29311  }
29312  if (spec & __Pyx_MEMVIEW_PTR) {
29313  if (!buf->suboffsets || (buf->suboffsets[dim] < 0)) {
29314  PyErr_Format(PyExc_ValueError,
29315  "Buffer is not indirectly accessible "
29316  "in dimension %d.", dim);
29317  goto fail;
29318  }
29319  }
29320  return 1;
29321 fail:
29322  return 0;
29323 }
29324 static int
29325 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
29326 {
29327  int i;
29328  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
29329  Py_ssize_t stride = 1;
29330  for (i = 0; i < ndim; i++) {
29331  if (stride * buf->itemsize != buf->strides[i] &&
29332  buf->shape[i] > 1)
29333  {
29334  PyErr_SetString(PyExc_ValueError,
29335  "Buffer not fortran contiguous.");
29336  goto fail;
29337  }
29338  stride = stride * buf->shape[i];
29339  }
29340  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
29341  Py_ssize_t stride = 1;
29342  for (i = ndim - 1; i >- 1; i--) {
29343  if (stride * buf->itemsize != buf->strides[i] &&
29344  buf->shape[i] > 1) {
29345  PyErr_SetString(PyExc_ValueError,
29346  "Buffer not C contiguous.");
29347  goto fail;
29348  }
29349  stride = stride * buf->shape[i];
29350  }
29351  }
29352  return 1;
29353 fail:
29354  return 0;
29355 }
29356 static int __Pyx_ValidateAndInit_memviewslice(
29357  int *axes_specs,
29358  int c_or_f_flag,
29359  int buf_flags,
29360  int ndim,
29361  __Pyx_TypeInfo *dtype,
29362  __Pyx_BufFmt_StackElem stack[],
29363  __Pyx_memviewslice *memviewslice,
29364  PyObject *original_obj)
29365 {
29366  struct __pyx_memoryview_obj *memview, *new_memview;
29367  __Pyx_RefNannyDeclarations
29368  Py_buffer *buf;
29369  int i, spec = 0, retval = -1;
29370  __Pyx_BufFmt_Context ctx;
29371  int from_memoryview = __pyx_memoryview_check(original_obj);
29372  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
29373  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
29374  original_obj)->typeinfo)) {
29375  memview = (struct __pyx_memoryview_obj *) original_obj;
29376  new_memview = NULL;
29377  } else {
29378  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
29379  original_obj, buf_flags, 0, dtype);
29380  new_memview = memview;
29381  if (unlikely(!memview))
29382  goto fail;
29383  }
29384  buf = &memview->view;
29385  if (buf->ndim != ndim) {
29386  PyErr_Format(PyExc_ValueError,
29387  "Buffer has wrong number of dimensions (expected %d, got %d)",
29388  ndim, buf->ndim);
29389  goto fail;
29390  }
29391  if (new_memview) {
29392  __Pyx_BufFmt_Init(&ctx, stack, dtype);
29393  if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
29394  }
29395  if ((unsigned) buf->itemsize != dtype->size) {
29396  PyErr_Format(PyExc_ValueError,
29397  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
29398  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
29399  buf->itemsize,
29400  (buf->itemsize > 1) ? "s" : "",
29401  dtype->name,
29402  dtype->size,
29403  (dtype->size > 1) ? "s" : "");
29404  goto fail;
29405  }
29406  for (i = 0; i < ndim; i++) {
29407  spec = axes_specs[i];
29408  if (!__pyx_check_strides(buf, i, ndim, spec))
29409  goto fail;
29410  if (!__pyx_check_suboffsets(buf, i, ndim, spec))
29411  goto fail;
29412  }
29413  if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
29414  goto fail;
29415  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
29416  new_memview != NULL) == -1)) {
29417  goto fail;
29418  }
29419  retval = 0;
29420  goto no_fail;
29421 fail:
29422  Py_XDECREF(new_memview);
29423  retval = -1;
29424 no_fail:
29425  __Pyx_RefNannyFinishContext();
29426  return retval;
29427 }
29428 
29429 /* ObjectToMemviewSlice */
29430  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
29431  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
29432  __Pyx_BufFmt_StackElem stack[1];
29433  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
29434  int retcode;
29435  if (obj == Py_None) {
29436  result.memview = (struct __pyx_memoryview_obj *) Py_None;
29437  return result;
29438  }
29439  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
29440  PyBUF_RECORDS_RO | writable_flag, 1,
29441  &__Pyx_TypeInfo_double, stack,
29442  &result, obj);
29443  if (unlikely(retcode == -1))
29444  goto __pyx_fail;
29445  return result;
29446 __pyx_fail:
29447  result.memview = NULL;
29448  result.data = NULL;
29449  return result;
29450 }
29451 
29452 /* ObjectToMemviewSlice */
29453  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
29454  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
29455  __Pyx_BufFmt_StackElem stack[1];
29456  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
29457  int retcode;
29458  if (obj == Py_None) {
29459  result.memview = (struct __pyx_memoryview_obj *) Py_None;
29460  return result;
29461  }
29462  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
29463  PyBUF_RECORDS_RO | writable_flag, 1,
29464  &__Pyx_TypeInfo_int, stack,
29465  &result, obj);
29466  if (unlikely(retcode == -1))
29467  goto __pyx_fail;
29468  return result;
29469 __pyx_fail:
29470  result.memview = NULL;
29471  result.data = NULL;
29472  return result;
29473 }
29474 
29475 /* CheckBinaryVersion */
29476  static int __Pyx_check_binary_version(void) {
29477  char ctversion[4], rtversion[4];
29478  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
29479  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
29480  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
29481  char message[200];
29482  PyOS_snprintf(message, sizeof(message),
29483  "compiletime version %s of module '%.100s' "
29484  "does not match runtime version %s",
29485  ctversion, __Pyx_MODULE_NAME, rtversion);
29486  return PyErr_WarnEx(NULL, message, 1);
29487  }
29488  return 0;
29489 }
29490 
29491 /* InitStrings */
29492  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29493  while (t->p) {
29494  #if PY_MAJOR_VERSION < 3
29495  if (t->is_unicode) {
29496  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29497  } else if (t->intern) {
29498  *t->p = PyString_InternFromString(t->s);
29499  } else {
29500  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29501  }
29502  #else
29503  if (t->is_unicode | t->is_str) {
29504  if (t->intern) {
29505  *t->p = PyUnicode_InternFromString(t->s);
29506  } else if (t->encoding) {
29507  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29508  } else {
29509  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29510  }
29511  } else {
29512  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29513  }
29514  #endif
29515  if (!*t->p)
29516  return -1;
29517  if (PyObject_Hash(*t->p) == -1)
29518  return -1;
29519  ++t;
29520  }
29521  return 0;
29522 }
29523 
29524 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
29525  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29526 }
29527 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
29528  Py_ssize_t ignore;
29529  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29530 }
29531 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29532 #if !CYTHON_PEP393_ENABLED
29533 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29534  char* defenc_c;
29535  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29536  if (!defenc) return NULL;
29537  defenc_c = PyBytes_AS_STRING(defenc);
29538 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29539  {
29540  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29541  char* c;
29542  for (c = defenc_c; c < end; c++) {
29543  if ((unsigned char) (*c) >= 128) {
29544  PyUnicode_AsASCIIString(o);
29545  return NULL;
29546  }
29547  }
29548  }
29549 #endif
29550  *length = PyBytes_GET_SIZE(defenc);
29551  return defenc_c;
29552 }
29553 #else
29554 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29555  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
29556 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29557  if (likely(PyUnicode_IS_ASCII(o))) {
29558  *length = PyUnicode_GET_LENGTH(o);
29559  return PyUnicode_AsUTF8(o);
29560  } else {
29561  PyUnicode_AsASCIIString(o);
29562  return NULL;
29563  }
29564 #else
29565  return PyUnicode_AsUTF8AndSize(o, length);
29566 #endif
29567 }
29568 #endif
29569 #endif
29570 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29571 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29572  if (
29573 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29574  __Pyx_sys_getdefaultencoding_not_ascii &&
29575 #endif
29576  PyUnicode_Check(o)) {
29577  return __Pyx_PyUnicode_AsStringAndSize(o, length);
29578  } else
29579 #endif
29580 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29581  if (PyByteArray_Check(o)) {
29582  *length = PyByteArray_GET_SIZE(o);
29583  return PyByteArray_AS_STRING(o);
29584  } else
29585 #endif
29586  {
29587  char* result;
29588  int r = PyBytes_AsStringAndSize(o, &result, length);
29589  if (unlikely(r < 0)) {
29590  return NULL;
29591  } else {
29592  return result;
29593  }
29594  }
29595 }
29596 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
29597  int is_true = x == Py_True;
29598  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
29599  else return PyObject_IsTrue(x);
29600 }
29601 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29602  int retval;
29603  if (unlikely(!x)) return -1;
29604  retval = __Pyx_PyObject_IsTrue(x);
29605  Py_DECREF(x);
29606  return retval;
29607 }
29608 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
29609 #if PY_MAJOR_VERSION >= 3
29610  if (PyLong_Check(result)) {
29611  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29612  "__int__ returned non-int (type %.200s). "
29613  "The ability to return an instance of a strict subclass of int "
29614  "is deprecated, and may be removed in a future version of Python.",
29615  Py_TYPE(result)->tp_name)) {
29616  Py_DECREF(result);
29617  return NULL;
29618  }
29619  return result;
29620  }
29621 #endif
29622  PyErr_Format(PyExc_TypeError,
29623  "__%.4s__ returned non-%.4s (type %.200s)",
29624  type_name, type_name, Py_TYPE(result)->tp_name);
29625  Py_DECREF(result);
29626  return NULL;
29627 }
29628 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29629 #if CYTHON_USE_TYPE_SLOTS
29630  PyNumberMethods *m;
29631 #endif
29632  const char *name = NULL;
29633  PyObject *res = NULL;
29634 #if PY_MAJOR_VERSION < 3
29635  if (likely(PyInt_Check(x) || PyLong_Check(x)))
29636 #else
29637  if (likely(PyLong_Check(x)))
29638 #endif
29639  return __Pyx_NewRef(x);
29640 #if CYTHON_USE_TYPE_SLOTS
29641  m = Py_TYPE(x)->tp_as_number;
29642  #if PY_MAJOR_VERSION < 3
29643  if (m && m->nb_int) {
29644  name = "int";
29645  res = m->nb_int(x);
29646  }
29647  else if (m && m->nb_long) {
29648  name = "long";
29649  res = m->nb_long(x);
29650  }
29651  #else
29652  if (likely(m && m->nb_int)) {
29653  name = "int";
29654  res = m->nb_int(x);
29655  }
29656  #endif
29657 #else
29658  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29659  res = PyNumber_Int(x);
29660  }
29661 #endif
29662  if (likely(res)) {
29663 #if PY_MAJOR_VERSION < 3
29664  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29665 #else
29666  if (unlikely(!PyLong_CheckExact(res))) {
29667 #endif
29668  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29669  }
29670  }
29671  else if (!PyErr_Occurred()) {
29672  PyErr_SetString(PyExc_TypeError,
29673  "an integer is required");
29674  }
29675  return res;
29676 }
29677 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29678  Py_ssize_t ival;
29679  PyObject *x;
29680 #if PY_MAJOR_VERSION < 3
29681  if (likely(PyInt_CheckExact(b))) {
29682  if (sizeof(Py_ssize_t) >= sizeof(long))
29683  return PyInt_AS_LONG(b);
29684  else
29685  return PyInt_AsSsize_t(b);
29686  }
29687 #endif
29688  if (likely(PyLong_CheckExact(b))) {
29689  #if CYTHON_USE_PYLONG_INTERNALS
29690  const digit* digits = ((PyLongObject*)b)->ob_digit;
29691  const Py_ssize_t size = Py_SIZE(b);
29692  if (likely(__Pyx_sst_abs(size) <= 1)) {
29693  ival = likely(size) ? digits[0] : 0;
29694  if (size == -1) ival = -ival;
29695  return ival;
29696  } else {
29697  switch (size) {
29698  case 2:
29699  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29700  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29701  }
29702  break;
29703  case -2:
29704  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29705  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29706  }
29707  break;
29708  case 3:
29709  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29710  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29711  }
29712  break;
29713  case -3:
29714  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29715  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29716  }
29717  break;
29718  case 4:
29719  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29720  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29721  }
29722  break;
29723  case -4:
29724  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29725  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29726  }
29727  break;
29728  }
29729  }
29730  #endif
29731  return PyLong_AsSsize_t(b);
29732  }
29733  x = PyNumber_Index(b);
29734  if (!x) return -1;
29735  ival = PyInt_AsSsize_t(x);
29736  Py_DECREF(x);
29737  return ival;
29738 }
29739 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
29740  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29741 }
29742 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
29743  return PyInt_FromSize_t(ival);
29744 }
29745 
29746 
29747 #endif /* Py_PYTHON_H */
Double c
Definition: Headers.h:53
void gauss_seidel_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
Definition: smoothers.c:114
Double f
Definition: Headers.h:53
Int ns
Definition: Headers.h:27
double pos(double a)
void gauss_seidel_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
Definition: smoothers.c:71
int basm_NR_init(int rowBlocks, SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p, PROTEUS_LAPACK_INTEGER ***subdomain_col_pivots_p)
Definition: smoothers.c:391
Double * z
Definition: Headers.h:40
void jacobi_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
Definition: smoothers.c:15
void asm_NR_prepare(SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots)
Definition: smoothers.c:293
Int n
Definition: Headers.h:27
int asm_NR_init(SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p)
Definition: smoothers.c:189
Double s
Definition: Headers.h:53
Int number
Definition: Headers.h:27
void basm_NR_prepare(int rowBlocks, int N, SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
Definition: smoothers.c:602
#define nnz
Definition: Richards.h:9
void nl_gauss_seidel_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
Definition: smoothers.c:142
Double u
Definition: Headers.h:53
void asm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots)
Definition: smoothers.c:268
void nl_jacobi_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
Definition: smoothers.c:26
void jacobi_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
Definition: smoothers.c:10
Double L
Definition: Headers.h:53
C implementations of multilevel smoother algorithms.
void asm_NR_solve(SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots)
Definition: smoothers.c:324
void basm_NR_solve(int rowBlocks, int N, SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
Definition: smoothers.c:668
Double q
Definition: Headers.h:53
void basm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots, PROTEUS_LAPACK_INTEGER **subdomain_col_pivots)
Definition: smoothers.c:574
Double v
Definition: Headers.h:53
Double r
Definition: Headers.h:53
Double T
Definition: Headers.h:53